autoproj 1.13.7 → 2.0.0.b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/.gemtest +0 -0
  3. data/Manifest.txt +27 -21
  4. data/Rakefile +4 -6
  5. data/bin/alocate +5 -1
  6. data/bin/amake +3 -53
  7. data/bin/aup +3 -50
  8. data/bin/autoproj +3 -264
  9. data/bin/autoproj_bootstrap +294 -349
  10. data/bin/autoproj_bootstrap.in +27 -3
  11. data/lib/autoproj.rb +23 -1
  12. data/lib/autoproj/autobuild.rb +51 -89
  13. data/lib/autoproj/base.rb +0 -9
  14. data/lib/autoproj/build_option.rb +1 -3
  15. data/lib/autoproj/cli.rb +1 -0
  16. data/lib/autoproj/cli/base.rb +155 -0
  17. data/lib/autoproj/cli/bootstrap.rb +119 -0
  18. data/lib/autoproj/cli/build.rb +72 -0
  19. data/lib/autoproj/cli/cache.rb +31 -0
  20. data/lib/autoproj/cli/clean.rb +37 -0
  21. data/lib/autoproj/cli/commit.rb +41 -0
  22. data/lib/autoproj/cli/doc.rb +22 -0
  23. data/lib/autoproj/cli/envsh.rb +22 -0
  24. data/lib/autoproj/cli/inspection_tool.rb +73 -0
  25. data/lib/autoproj/cli/locate.rb +96 -0
  26. data/lib/autoproj/cli/log.rb +26 -0
  27. data/lib/autoproj/cli/main.rb +249 -0
  28. data/lib/autoproj/cli/main_test.rb +57 -0
  29. data/lib/autoproj/cli/osdeps.rb +30 -0
  30. data/lib/autoproj/cli/query.rb +43 -0
  31. data/lib/autoproj/cli/reconfigure.rb +19 -0
  32. data/lib/autoproj/cli/reset.rb +7 -32
  33. data/lib/autoproj/cli/show.rb +219 -0
  34. data/lib/autoproj/cli/snapshot.rb +1 -1
  35. data/lib/autoproj/cli/status.rb +149 -0
  36. data/lib/autoproj/cli/switch_config.rb +28 -0
  37. data/lib/autoproj/cli/tag.rb +9 -35
  38. data/lib/autoproj/cli/test.rb +34 -55
  39. data/lib/autoproj/cli/update.rb +158 -0
  40. data/lib/autoproj/cli/versions.rb +32 -69
  41. data/lib/autoproj/configuration.rb +95 -34
  42. data/lib/autoproj/default.osdeps +25 -35
  43. data/lib/autoproj/environment.rb +85 -63
  44. data/lib/autoproj/exceptions.rb +50 -0
  45. data/lib/autoproj/gitorious.rb +11 -9
  46. data/lib/autoproj/manifest.rb +199 -231
  47. data/lib/autoproj/metapackage.rb +0 -8
  48. data/lib/autoproj/ops/build.rb +1 -17
  49. data/lib/autoproj/ops/configuration.rb +92 -90
  50. data/lib/autoproj/ops/import.rb +222 -0
  51. data/lib/autoproj/ops/loader.rb +18 -8
  52. data/lib/autoproj/ops/main_config_switcher.rb +45 -73
  53. data/lib/autoproj/ops/snapshot.rb +5 -10
  54. data/lib/autoproj/ops/tools.rb +10 -44
  55. data/lib/autoproj/options.rb +35 -6
  56. data/lib/autoproj/osdeps.rb +97 -68
  57. data/lib/autoproj/package_selection.rb +39 -20
  58. data/lib/autoproj/package_set.rb +26 -24
  59. data/lib/autoproj/reporter.rb +91 -0
  60. data/lib/autoproj/system.rb +50 -149
  61. data/lib/autoproj/variable_expansion.rb +32 -6
  62. data/lib/autoproj/vcs_definition.rb +57 -17
  63. data/lib/autoproj/version.rb +1 -1
  64. data/lib/autoproj/workspace.rb +550 -0
  65. data/test/ops/test_snapshot.rb +26 -0
  66. data/test/test_package.rb +30 -0
  67. data/test/test_vcs_definition.rb +46 -0
  68. metadata +55 -50
  69. data/bin/autolocate +0 -3
  70. data/bin/autoproj-bootstrap +0 -68
  71. data/bin/autoproj-cache +0 -18
  72. data/bin/autoproj-clean +0 -13
  73. data/bin/autoproj-commit +0 -10
  74. data/bin/autoproj-create-set +0 -118
  75. data/bin/autoproj-doc +0 -28
  76. data/bin/autoproj-envsh +0 -14
  77. data/bin/autoproj-list +0 -69
  78. data/bin/autoproj-locate +0 -85
  79. data/bin/autoproj-log +0 -5
  80. data/bin/autoproj-query +0 -82
  81. data/bin/autoproj-reset +0 -13
  82. data/bin/autoproj-show +0 -192
  83. data/bin/autoproj-snapshot +0 -27
  84. data/bin/autoproj-switch-config +0 -24
  85. data/bin/autoproj-tag +0 -13
  86. data/bin/autoproj-test +0 -31
  87. data/bin/autoproj-versions +0 -20
  88. data/bin/autoproj_stress_test +0 -40
  89. data/lib/autoproj/cmdline.rb +0 -1649
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5d9ce5749393ef4ef70b623d58c40081a5627c45
4
- data.tar.gz: 531e965538bdfd19e8ae40290d2e53bcfd5031a6
3
+ metadata.gz: f1e302cab6677a8cb13970ecc83bd4df3b88be03
4
+ data.tar.gz: 5e4a7dfe45bbeab8e593c941990d30dd0c78d913
5
5
  SHA512:
6
- metadata.gz: 0a834c5d645039281a09328febb4cf736d4b5a5151813752467195b36c6a15ba383352693a0df4a1443296d7e67574e2c396ceeee2f4a8697bdce8a037143d8b
7
- data.tar.gz: 7f0359dbee5d7c6674e36af22d1096592aaec38640eeecc8ec6f075db14eee8482037bd5437b6370f920e30db4e5247d7a1b9831cccdaf4c0b7e1561b9edeed3
6
+ metadata.gz: f2238a795517a8bfa3261f8e8a2a14a1e1be30d90fbb56469cb6634520a5aed280bb1746c511fe1db7443725142d9f8a1a39a67422432977787dae61b6f02446
7
+ data.tar.gz: e02d859e9a811a1bd09bb1ac30e69d0c5ee3425ae28e1f704e938217b53c01bd4042d927ea54b9d24e9a3af0690c89c3d24cbc25cff5df7bff938c63bbf683d7
File without changes
@@ -5,43 +5,43 @@ Rakefile
5
5
  bin/alocate
6
6
  bin/amake
7
7
  bin/aup
8
- bin/autolocate
9
8
  bin/autoproj
10
- bin/autoproj-bootstrap
11
- bin/autoproj-cache
12
- bin/autoproj-clean
13
- bin/autoproj-commit
14
- bin/autoproj-create-set
15
- bin/autoproj-doc
16
- bin/autoproj-envsh
17
- bin/autoproj-list
18
- bin/autoproj-locate
19
- bin/autoproj-log
20
- bin/autoproj-query
21
- bin/autoproj-reset
22
- bin/autoproj-show
23
- bin/autoproj-snapshot
24
- bin/autoproj-switch-config
25
- bin/autoproj-tag
26
- bin/autoproj-test
27
- bin/autoproj-versions
28
9
  bin/autoproj_bootstrap
29
10
  bin/autoproj_bootstrap.in
30
- bin/autoproj_stress_test
31
11
  lib/autoproj.rb
32
12
  lib/autoproj/autobuild.rb
33
13
  lib/autoproj/base.rb
34
14
  lib/autoproj/build_option.rb
35
15
  lib/autoproj/cli.rb
16
+ lib/autoproj/cli/base.rb
17
+ lib/autoproj/cli/bootstrap.rb
18
+ lib/autoproj/cli/build.rb
19
+ lib/autoproj/cli/cache.rb
20
+ lib/autoproj/cli/clean.rb
21
+ lib/autoproj/cli/commit.rb
22
+ lib/autoproj/cli/doc.rb
23
+ lib/autoproj/cli/envsh.rb
24
+ lib/autoproj/cli/inspection_tool.rb
25
+ lib/autoproj/cli/locate.rb
26
+ lib/autoproj/cli/log.rb
27
+ lib/autoproj/cli/main.rb
28
+ lib/autoproj/cli/main_test.rb
29
+ lib/autoproj/cli/osdeps.rb
30
+ lib/autoproj/cli/query.rb
31
+ lib/autoproj/cli/reconfigure.rb
36
32
  lib/autoproj/cli/reset.rb
33
+ lib/autoproj/cli/show.rb
37
34
  lib/autoproj/cli/snapshot.rb
35
+ lib/autoproj/cli/status.rb
36
+ lib/autoproj/cli/switch_config.rb
38
37
  lib/autoproj/cli/tag.rb
39
38
  lib/autoproj/cli/test.rb
39
+ lib/autoproj/cli/update.rb
40
40
  lib/autoproj/cli/versions.rb
41
- lib/autoproj/cmdline.rb
42
41
  lib/autoproj/configuration.rb
43
42
  lib/autoproj/default.osdeps
44
43
  lib/autoproj/environment.rb
44
+ lib/autoproj/exceptions.rb
45
45
  lib/autoproj/gitorious.rb
46
46
  lib/autoproj/installation_manifest.rb
47
47
  lib/autoproj/manifest.rb
@@ -49,6 +49,7 @@ lib/autoproj/metapackage.rb
49
49
  lib/autoproj/ops/build.rb
50
50
  lib/autoproj/ops/cache.rb
51
51
  lib/autoproj/ops/configuration.rb
52
+ lib/autoproj/ops/import.rb
52
53
  lib/autoproj/ops/loader.rb
53
54
  lib/autoproj/ops/main_config_switcher.rb
54
55
  lib/autoproj/ops/snapshot.rb
@@ -60,6 +61,7 @@ lib/autoproj/package_manifest.rb
60
61
  lib/autoproj/package_selection.rb
61
62
  lib/autoproj/package_set.rb
62
63
  lib/autoproj/query.rb
64
+ lib/autoproj/reporter.rb
63
65
  lib/autoproj/system.rb
64
66
  lib/autoproj/templates/create-set/packages.autobuild
65
67
  lib/autoproj/templates/create-set/source.yml
@@ -67,6 +69,7 @@ lib/autoproj/test.rb
67
69
  lib/autoproj/variable_expansion.rb
68
70
  lib/autoproj/vcs_definition.rb
69
71
  lib/autoproj/version.rb
72
+ lib/autoproj/workspace.rb
70
73
  samples/autoproj/README.txt
71
74
  samples/autoproj/init.rb
72
75
  samples/autoproj/manifest
@@ -88,6 +91,7 @@ test/data/test_manifest/autoproj/local_set/local.autobuild
88
91
  test/data/test_manifest/autoproj/local_set/source.yml
89
92
  test/data/test_manifest/autoproj/manifest
90
93
  test/ops/test_configuration.rb
94
+ test/ops/test_snapshot.rb
91
95
  test/package_managers/apt-dpkg-status
92
96
  test/package_managers/apt-dpkg-status.installed-last
93
97
  test/package_managers/apt-dpkg-status.noninstalled-last
@@ -96,4 +100,6 @@ test/package_managers/test_gem.rb
96
100
  test/package_managers/test_pip.rb
97
101
  test/test_manifest.rb
98
102
  test/test_os_dependencies.rb
103
+ test/test_package.rb
99
104
  test/test_package_manifest.rb
105
+ test/test_vcs_definition.rb
data/Rakefile CHANGED
@@ -18,9 +18,9 @@ Utilrb::Rake.hoe do
18
18
  license 'BSD'
19
19
 
20
20
  extra_deps <<
21
- ['autobuild', '~> 1.9.0'] <<
22
- ['utilrb', '~> 2.0.0'] <<
23
- ['highline', '>= 1.5.0']
21
+ ['autobuild', '~> 1.9', '>= 1.9.0'] <<
22
+ ['utilrb', '~> 2.0', '>= 2.0.0'] <<
23
+ ['highline', '~> 1.7', '>= 1.7.0']
24
24
  end
25
25
  end
26
26
  end
@@ -32,7 +32,6 @@ namespace 'dist' do
32
32
  build_option_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'build_option.rb'))
33
33
  config_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'configuration.rb'))
34
34
  osdeps_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'osdeps.rb'))
35
- options_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'options.rb'))
36
35
  system_code = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'system.rb'))
37
36
  osdeps_defaults = File.read(File.join(Dir.pwd, 'lib', 'autoproj', 'default.osdeps'))
38
37
  require 'autobuild'
@@ -51,7 +50,7 @@ namespace 'dist' do
51
50
  osdeps_defaults = YAML.dump(osdeps)
52
51
  # Since we are using gsub to replace the content in the bootstrap file,
53
52
  # we have to quote all \
54
- [osdeps_code, options_code, system_code, osdeps_defaults, tools_code].each do |text|
53
+ [osdeps_code, system_code, osdeps_defaults, tools_code].each do |text|
55
54
  text.gsub! /\\/, '\\\\\\\\'
56
55
  end
57
56
 
@@ -59,7 +58,6 @@ namespace 'dist' do
59
58
  gsub('BUILD_OPTION_CODE', build_option_code).
60
59
  gsub('CONFIG_CODE', config_code).
61
60
  gsub('OSDEPS_CODE', osdeps_code).
62
- gsub('OPTIONS_CODE', options_code).
63
61
  gsub('SYSTEM_CODE', system_code).
64
62
  gsub('OSDEPS_DEFAULTS', osdeps_defaults).
65
63
  gsub('TOOLS_CODE', tools_code)
@@ -1,2 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
- load File.expand_path('autoproj-locate', File.dirname(__FILE__))
2
+
3
+ require 'autoproj/cli/locate'
4
+ Autoproj::CLI.basic_setup
5
+ Autoproj::CLI::Main.start(['locate', *ARGV])
6
+
data/bin/amake CHANGED
@@ -1,56 +1,6 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- require 'optparse'
4
-
5
- build_all = false
6
- mode = "build"
7
-
8
- parser = OptionParser.new do |opt|
9
- opt.banner = "amake [options] [dir_or_package]
10
- Runs autoproj build for the given directory or package name.
11
- Selects the current directory if none is given
12
-
13
- Accepts all options from autoproj build plus the following options:
14
-
15
- "
16
- opt.on('--all', 'runs autoproj build without arguments (does not add the current directory)') do
17
- build_all = true
18
- end
19
- opt.on('--force', 'runs autoproj force-build instead of autoproj build') do
20
- mode = "force-build"
21
- end
22
- opt.on('--rebuild', 'runs autoproj force-build instead of autoproj build') do
23
- mode = "rebuild"
24
- end
25
- opt.on('--help', 'shows this help message') do
26
- puts parser
27
- exit(0)
28
- end
29
- end
30
-
31
- # Accept options that are invalid in +parser+, to pass them on to autoproj
32
- # itself
33
- options = ARGV.dup
34
- remaining = []
35
- while !options.empty?
36
- begin
37
- head = options.shift
38
- remaining.concat(parser.parse([head]))
39
- rescue OptionParser::InvalidOption
40
- remaining << head
41
- retry
42
- end
43
- end
44
-
45
- # If --all is not given *and* there is no non-option argument (i.e. no directory
46
- # / package name), add the current directory to the command line
47
- if remaining.grep(/^-/).size == remaining.size && !build_all
48
- remaining.push '.'
49
- end
50
-
51
- remaining.unshift mode
52
- ORIGINAL_ARGV = ARGV.dup # This is used in case autoproj needs to update itself
53
- ARGV.clear
54
- ARGV.concat(remaining)
55
- load File.expand_path('autoproj', File.dirname(__FILE__))
3
+ require 'autoproj/cli/main'
4
+ Autoproj::CLI.basic_setup
5
+ Autoproj::CLI::Main.start(['build', '--amake', *ARGV])
56
6
 
data/bin/aup CHANGED
@@ -1,52 +1,5 @@
1
1
  #! /usr/bin/env ruby
2
- require 'optparse'
3
- require 'autoproj'
4
-
5
- build_all = (Dir.pwd == Autoproj.root_dir)
6
- parser = OptionParser.new do |opt|
7
- opt.banner = "aup [options] [dir_or_package]
8
- Runs autoproj update for the given directory or package name.
9
- Selects the current directory if none is given. Override by
10
- passing the --all option.
11
-
12
- Accepts all options from autoproj update plus the following options:
13
-
14
- "
15
- opt.on('--all', 'runs autoproj build without arguments (does not add the current directory)') do
16
- build_all = true
17
- end
18
- opt.on('--help', 'shows this help message') do
19
- puts parser
20
- exit(0)
21
- end
22
- end
23
-
24
- # Accept options that are invalid in +parser+, to pass them on to autoproj
25
- # itself
26
- options = ARGV.dup
27
- remaining = []
28
- while !options.empty?
29
- begin
30
- head = options.shift
31
- remaining.concat(parser.parse([head]))
32
- rescue OptionParser::InvalidOption
33
- remaining << head
34
- retry
35
- end
36
- end
37
-
38
-
39
- # If --all is not given *and* there is no non-option argument (i.e. no directory
40
- # / package name), add the current directory to the command line
41
- #
42
- # BUT make running 'aup' in the root directory the equivalent of aup --all
43
- if remaining.grep(/^-/).size == remaining.size && !build_all
44
- remaining.push '.'
45
- end
46
- remaining.unshift 'update'
47
-
48
- ORIGINAL_ARGV = ARGV.dup # This is used in case autoproj needs to update itself
49
- ARGV.clear
50
- ARGV.concat(remaining)
51
- load File.expand_path('autoproj', File.dirname(__FILE__))
52
2
 
3
+ require 'autoproj/cli/main'
4
+ Autoproj::CLI.basic_setup
5
+ Autoproj::CLI::Main.start(['update', '--aup', *ARGV])
@@ -1,269 +1,8 @@
1
1
  #! /usr/bin/env ruby
2
2
 
3
- if !defined?(ORIGINAL_ARGV)
4
- ORIGINAL_ARGV = ARGV.dup
5
- end
6
-
7
- if RUBY_VERSION < "1.9.2"
8
- STDERR.puts "autoproj requires Ruby >= 1.9.2"
9
- exit 1
10
- end
11
-
12
3
  require 'autoproj'
13
4
  require 'autoproj/autobuild'
14
- require 'open-uri'
15
- require 'autoproj/cmdline'
16
-
17
- include Autoproj
18
-
19
- InputError = Autoproj::InputError
20
-
21
- def color(*args)
22
- Autoproj.color(*args)
23
- end
24
-
25
- Encoding.default_internal = Encoding::UTF_8
26
- Encoding.default_external = Encoding::UTF_8
27
- Autoproj::OSDependencies.autodetect_ruby
28
-
29
- # Check the first element of ARGV. If a tool called autoproj-VALUE exists, just
30
- # pass the hand to it
31
- prefix = File.expand_path(__FILE__)
32
- if File.file?("#{prefix}-#{ARGV.first}")
33
- binary = "#{prefix}-#{ARGV.shift}"
34
- # RubyGems have a BIG performance problem when $LOADED_PATH starts to be
35
- # big.
36
- #
37
- # So, if the sub-script is Ruby-based, just load it and exit
38
- if File.readlines(binary).first =~ /ruby/
39
- load binary
40
- exit
41
- else
42
- exec(binary, *ARGV)
43
- end
44
- end
45
-
46
- # Find the autoproj root dir
47
- Autoproj::CmdLine.report do
48
- selected_packages = Autoproj::CmdLine.parse_arguments(ARGV.dup)
49
-
50
- # Expand directories in the selected_packages set, before we chdir to the
51
- # autoproj root
52
- root_dir = Autoproj.root_dir
53
- selected_packages.map! do |name|
54
- if File.directory?(name)
55
- File.expand_path(name) + File::SEPARATOR
56
- else
57
- name
58
- end
59
- end
60
-
61
- needs_update_config = false
62
- selected_packages.delete_if do |name|
63
- if name =~ /^#{Regexp.quote(Autoproj.config_dir + File::SEPARATOR)}/ ||
64
- name =~ /^#{Regexp.quote(Autoproj.remotes_dir + File::SEPARATOR)}/
65
- needs_update_config = true
66
- elsif (Autoproj.config_dir + File::SEPARATOR) =~ /^#{Regexp.quote(name)}/
67
- needs_update_config = true
68
- false
69
- end
70
- end
71
-
72
- Dir.chdir(root_dir)
73
-
74
- # Basic initialization
75
- Autoproj::CmdLine.initialize
76
- if needs_update_config
77
- Autoproj::CmdLine.update_configuration
78
- if selected_packages.empty?
79
- exit 0
80
- end
81
- elsif selected_packages.empty?
82
- Autoproj::CmdLine.update_myself
83
- Autoproj::CmdLine.update_configuration
84
- else
85
- begin
86
- old_value = Autobuild.do_update
87
- Autobuild.do_update = false
88
- Autoproj::CmdLine.update_configuration
89
- ensure
90
- Autobuild.do_update = old_value
91
- end
92
- end
93
- Autoproj::CmdLine.load_configuration
94
- manifest = Autoproj.manifest
95
-
96
- Autoproj::CmdLine.setup_all_package_directories
97
- # resolve_user_selection auto-adds packages present on disk but not listed
98
- # in the manifest. However, since we have not yet loaded overrides /
99
- # package blocks, it is possible that it contains excluded / ignored
100
- # packages
101
- #
102
- # First do the resolution to get auto-add, finalize the package
103
- # configuration, and then re-resolve
104
- Autoproj::CmdLine.resolve_user_selection(selected_packages)
105
- # Now load the rest of the configuration
106
- Autoproj::CmdLine.finalize_package_setup
107
- # Finally, filter out exclusions
108
- resolved_selected_packages =
109
- Autoproj::CmdLine.resolve_user_selection(selected_packages)
110
- Autoproj::CmdLine.validate_user_selection(selected_packages, resolved_selected_packages)
111
-
112
- if !selected_packages.empty?
113
- command_line_selection = resolved_selected_packages.dup
114
- else
115
- command_line_selection = Array.new
116
- end
117
- Autoproj.manifest.explicit_selection = resolved_selected_packages
118
- selected_packages = resolved_selected_packages
119
-
120
- if other_root = Autoproj::CmdLine.update_from
121
- Autobuild::Package.each do |_, pkg|
122
- if pkg.importer.respond_to?(:pick_from_autoproj_root)
123
- if !pkg.importer.pick_from_autoproj_root(pkg, other_root)
124
- pkg.update = false
125
- end
126
- else
127
- pkg.update = false
128
- end
129
- end
130
- end
131
-
132
- # If in verbose mode, or if we only update sources, list the sources
133
- if Autoproj.verbose || Autoproj::CmdLine.display_configuration?
134
- Autoproj::CmdLine.display_configuration(manifest, selected_packages.packages)
135
- end
136
-
137
- if Autoproj::CmdLine.only_config? || Autoproj::CmdLine.reconfigure?
138
- exit(0)
139
- end
140
-
141
- if Autoproj::CmdLine.only_status?
142
- all_enabled_packages = Autoproj::CmdLine.import_packages(selected_packages)
143
- result = Autoproj::CmdLine.status(all_enabled_packages)
144
- if Autoproj::CmdLine.status_exit_code?
145
- code = 0
146
- if result.uncommitted
147
- code |= 1
148
- end
149
- if result.local
150
- code |= 2
151
- end
152
- if result.remote
153
- code |= 4
154
- end
155
- exit(code)
156
- else
157
- exit(0)
158
- end
159
- elsif Autoproj::CmdLine.check?
160
- all_enabled_packages = Autoproj::CmdLine.import_packages(selected_packages)
161
- Autoproj::CmdLine.check(all_enabled_packages)
162
- exit(0)
163
- elsif Autoproj::CmdLine.manifest_update?
164
- all_enabled_packages = Autoproj::CmdLine.import_packages(selected_packages)
165
- Autoproj::CmdLine.manifest_update(all_enabled_packages)
166
- exit(0)
167
- elsif Autoproj::CmdLine.snapshot?
168
- all_enabled_packages = Autoproj::CmdLine.import_packages(selected_packages)
169
- Autoproj::CmdLine.snapshot(Autoproj::CmdLine.snapshot_dir, all_enabled_packages)
170
- exit(0)
171
- elsif Autoproj::CmdLine.revshow_osdeps?
172
- all_enabled_packages = Autoproj::CmdLine.import_packages(selected_packages)
173
- Autoproj::CmdLine.revshow_osdeps(all_enabled_packages)
174
- exit(0)
175
- elsif Autoproj::CmdLine.show_osdeps?
176
- all_enabled_packages = Autoproj::CmdLine.import_packages(selected_packages)
177
- Autoproj::CmdLine.show_osdeps(all_enabled_packages)
178
- exit(0)
179
- elsif Autoproj::CmdLine.list_unused?
180
- all_enabled_packages = Autoproj::CmdLine.import_packages(selected_packages)
181
- Autoproj::CmdLine.list_unused(all_enabled_packages)
182
- exit(0)
183
- end
184
-
185
- STDERR.puts
186
- STDERR.puts color("autoproj: importing and loading selected packages", :bold)
187
-
188
- # Install prepackaged dependencies needed to import and build the packages.
189
- # The required information is in the package sets configuration.
190
- if Autoproj::CmdLine.update_os_dependencies?
191
- Autoproj.osdeps.install(Autoproj.build_system_dependencies)
192
- end
193
-
194
- # Now, we actually do the import. Unfortunately, at this stage, we need to
195
- # import the package and its dependencies ourselves so that we are able to
196
- # build the list of packages that have actually been selected on the command
197
- # line.
198
- all_enabled_packages = Autoproj::CmdLine.import_packages(selected_packages)
199
- Autoproj::CmdLine.load_all_available_package_manifests(false)
200
- Autoproj::CmdLine.export_installation_manifest
201
-
202
- if Autoproj::CmdLine.update_os_dependencies? && !all_enabled_packages.empty?
203
- begin
204
- update_mode = Autobuild.do_update
205
- Autobuild.do_update ||= Autoproj::CmdLine.osdeps?
206
- manifest.install_os_dependencies(all_enabled_packages)
207
- ensure
208
- Autobuild.do_update = update_mode
209
- end
210
- end
211
-
212
- if all_enabled_packages.empty?
213
- STDERR.puts color("autoproj: nothing to do", :bold)
214
- elsif Autoproj::CmdLine.build?
215
- Autoproj.message("autoproj: building and installing packages", :bold)
216
- Autoproj::CmdLine.build_packages(command_line_selection, all_enabled_packages)
217
- end
218
-
219
- if Autoproj::CmdLine.update_envsh?
220
- Autoproj.export_env_sh
221
- Autoproj.message "autoproj: updated #{Autoproj.root_dir}/#{Autoproj::ENV_FILENAME}", :green
222
- end
223
-
224
- if Autoproj::CmdLine.show_statistics?
225
- per_phase = Hash.new
226
- per_type = Hash.new
227
-
228
- Autoproj.message
229
- Autoproj.message "statistics about the build", :bold
230
-
231
- Autoproj.manifest.each_autobuild_package.sort_by(&:name).each do |pkg|
232
- next if pkg.statistics.empty?
233
-
234
- if per_phase.empty?
235
- Autoproj.message "detailed per package"
236
- end
237
-
238
- puts " #{pkg.name}: %.1fs" % [pkg.statistics.values.inject(&:+)]
239
- pkg.statistics.each_key.sort.each do |phase|
240
- per_phase[phase] ||= 0
241
- per_phase[phase] += pkg.statistics[phase]
242
- per_type[pkg.class] ||= Hash.new
243
- per_type[pkg.class][phase] ||= 0
244
- per_type[pkg.class][phase] += pkg.statistics[phase]
245
- puts " #{phase}: %.1fs" % [pkg.statistics[phase]]
246
- end
247
- end
248
-
249
- if !per_type.empty?
250
- Autoproj.message
251
- Autoproj.message "detailed per package type"
252
- per_type.each do |pkg_type, phases|
253
- Autoproj.message " #{pkg_type.name}: %.1fs" % [phases.values.inject(&:+)]
254
- phases.each_key.sort.each do |phase_name|
255
- Autoproj.message " #{phase_name}: %.1fs" % [phases[phase_name]]
256
- end
257
- end
258
- end
259
-
260
- if !per_phase.empty?
261
- Autoproj.message
262
- Autoproj.message "summary per phase"
263
- per_phase.keys.sort.each do |phase_name|
264
- Autoproj.message " #{phase_name}: %.1fs" % [per_phase[phase_name]]
265
- end
266
- end
267
- end
268
- end
5
+ require 'autoproj/cli/main'
6
+ Autoproj::CLI.basic_setup
7
+ Autoproj::CLI::Main.start(ARGV)
269
8