autoproj 2.12.1 → 2.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +25 -0
- data/.github/workflows/test.yml +30 -0
- data/.rubocop.yml +79 -91
- data/.rubocop_todo.yml +1473 -0
- data/Gemfile +9 -9
- data/Rakefile +24 -24
- data/autoproj.gemspec +24 -22
- data/bin/alocate +4 -4
- data/bin/alog +6 -7
- data/bin/amake +4 -4
- data/bin/aup +4 -4
- data/bin/autoproj +3 -3
- data/bin/autoproj_bootstrap +225 -200
- data/bin/autoproj_bootstrap.in +7 -8
- data/bin/autoproj_install +224 -199
- data/bin/autoproj_install.in +6 -7
- data/lib/autoproj/aruba_minitest.rb +6 -11
- data/lib/autoproj/autobuild.rb +9 -6
- data/lib/autoproj/autobuild_extensions/archive_importer.rb +10 -11
- data/lib/autoproj/autobuild_extensions/dsl.rb +66 -36
- data/lib/autoproj/autobuild_extensions/git.rb +27 -26
- data/lib/autoproj/autobuild_extensions/package.rb +23 -22
- data/lib/autoproj/autobuild_extensions/python.rb +18 -0
- data/lib/autoproj/autobuild_extensions/svn.rb +1 -2
- data/lib/autoproj/base.rb +1 -1
- data/lib/autoproj/bash_completion.rb +5 -6
- data/lib/autoproj/build_option.rb +22 -24
- data/lib/autoproj/cli/base.rb +26 -26
- data/lib/autoproj/cli/bootstrap.rb +14 -16
- data/lib/autoproj/cli/build.rb +10 -7
- data/lib/autoproj/cli/cache.rb +11 -11
- data/lib/autoproj/cli/clean.rb +10 -10
- data/lib/autoproj/cli/commit.rb +7 -8
- data/lib/autoproj/cli/doc.rb +2 -2
- data/lib/autoproj/cli/envsh.rb +1 -2
- data/lib/autoproj/cli/exec.rb +60 -20
- data/lib/autoproj/cli/inspection_tool.rb +13 -7
- data/lib/autoproj/cli/locate.rb +30 -41
- data/lib/autoproj/cli/log.rb +7 -7
- data/lib/autoproj/cli/main.rb +217 -205
- data/lib/autoproj/cli/main_doc.rb +22 -21
- data/lib/autoproj/cli/main_global.rb +44 -19
- data/lib/autoproj/cli/main_plugin.rb +18 -18
- data/lib/autoproj/cli/main_test.rb +28 -27
- data/lib/autoproj/cli/manifest.rb +7 -7
- data/lib/autoproj/cli/osdeps.rb +12 -11
- data/lib/autoproj/cli/patcher.rb +2 -3
- data/lib/autoproj/cli/query.rb +17 -18
- data/lib/autoproj/cli/reconfigure.rb +1 -2
- data/lib/autoproj/cli/reset.rb +9 -12
- data/lib/autoproj/cli/show.rb +38 -39
- data/lib/autoproj/cli/status.rb +56 -44
- data/lib/autoproj/cli/switch_config.rb +5 -6
- data/lib/autoproj/cli/tag.rb +12 -11
- data/lib/autoproj/cli/test.rb +7 -7
- data/lib/autoproj/cli/update.rb +97 -43
- data/lib/autoproj/cli/utility.rb +14 -12
- data/lib/autoproj/cli/version.rb +42 -40
- data/lib/autoproj/cli/versions.rb +14 -15
- data/lib/autoproj/cli/watch.rb +33 -37
- data/lib/autoproj/cli/which.rb +16 -20
- data/lib/autoproj/cli.rb +4 -2
- data/lib/autoproj/configuration.rb +78 -86
- data/lib/autoproj/default.osdeps +29 -3
- data/lib/autoproj/environment.rb +42 -23
- data/lib/autoproj/exceptions.rb +9 -3
- data/lib/autoproj/find_workspace.rb +20 -25
- data/lib/autoproj/git_server_configuration.rb +40 -44
- data/lib/autoproj/gitorious.rb +1 -1
- data/lib/autoproj/installation_manifest.rb +64 -29
- data/lib/autoproj/local_package_set.rb +13 -11
- data/lib/autoproj/manifest.rb +139 -132
- data/lib/autoproj/metapackage.rb +2 -6
- data/lib/autoproj/ops/atomic_write.rb +7 -6
- data/lib/autoproj/ops/build.rb +4 -6
- data/lib/autoproj/ops/cache.rb +41 -43
- data/lib/autoproj/ops/cached_env.rb +5 -4
- data/lib/autoproj/ops/configuration.rb +519 -507
- data/lib/autoproj/ops/import.rb +88 -63
- data/lib/autoproj/ops/install.rb +218 -192
- data/lib/autoproj/ops/loader.rb +77 -76
- data/lib/autoproj/ops/main_config_switcher.rb +36 -45
- data/lib/autoproj/ops/phase_reporting.rb +4 -4
- data/lib/autoproj/ops/snapshot.rb +250 -247
- data/lib/autoproj/ops/tools.rb +76 -78
- data/lib/autoproj/ops/watch.rb +6 -6
- data/lib/autoproj/ops/which.rb +17 -14
- data/lib/autoproj/options.rb +13 -2
- data/lib/autoproj/os_package_installer.rb +102 -92
- data/lib/autoproj/os_package_query.rb +7 -13
- data/lib/autoproj/os_package_resolver.rb +189 -140
- data/lib/autoproj/os_repository_installer.rb +4 -4
- data/lib/autoproj/os_repository_resolver.rb +8 -6
- data/lib/autoproj/package_definition.rb +12 -13
- data/lib/autoproj/package_managers/apt_dpkg_manager.rb +19 -11
- data/lib/autoproj/package_managers/bundler_manager.rb +186 -129
- data/lib/autoproj/package_managers/debian_version.rb +25 -21
- data/lib/autoproj/package_managers/emerge_manager.rb +2 -3
- data/lib/autoproj/package_managers/gem_manager.rb +68 -77
- data/lib/autoproj/package_managers/homebrew_manager.rb +3 -4
- data/lib/autoproj/package_managers/manager.rb +8 -3
- data/lib/autoproj/package_managers/pacman_manager.rb +2 -3
- data/lib/autoproj/package_managers/pip_manager.rb +30 -28
- data/lib/autoproj/package_managers/pkg_manager.rb +3 -4
- data/lib/autoproj/package_managers/port_manager.rb +2 -3
- data/lib/autoproj/package_managers/shell_script_manager.rb +47 -25
- data/lib/autoproj/package_managers/unknown_os_manager.rb +5 -8
- data/lib/autoproj/package_managers/yum_manager.rb +12 -15
- data/lib/autoproj/package_managers/zypper_manager.rb +11 -14
- data/lib/autoproj/package_manifest.rb +28 -74
- data/lib/autoproj/package_selection.rb +187 -187
- data/lib/autoproj/package_set.rb +145 -114
- data/lib/autoproj/python.rb +297 -0
- data/lib/autoproj/query_base.rb +20 -14
- data/lib/autoproj/reporter.rb +19 -19
- data/lib/autoproj/repository_managers/apt.rb +102 -68
- data/lib/autoproj/repository_managers/unknown_os_manager.rb +3 -3
- data/lib/autoproj/ros_condition_parser.rb +84 -0
- data/lib/autoproj/ros_package_manifest.rb +125 -0
- data/lib/autoproj/shell_completion.rb +16 -13
- data/lib/autoproj/source_package_query.rb +29 -36
- data/lib/autoproj/system.rb +32 -21
- data/lib/autoproj/test.rb +131 -106
- data/lib/autoproj/variable_expansion.rb +10 -10
- data/lib/autoproj/vcs_definition.rb +53 -37
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj/workspace.rb +143 -108
- data/lib/autoproj/zsh_completion.rb +8 -9
- data/lib/autoproj.rb +55 -53
- data/samples/autoproj/init.rb +1 -2
- metadata +86 -65
- data/.travis.yml +0 -22
data/lib/autoproj/cli/main.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require
|
8
|
-
require
|
1
|
+
require "thor"
|
2
|
+
require "tty/color"
|
3
|
+
require "autoproj/cli/main_doc"
|
4
|
+
require "autoproj/cli/main_test"
|
5
|
+
require "autoproj/cli/main_plugin"
|
6
|
+
require "autoproj/cli/main_global"
|
7
|
+
require "autoproj/cli"
|
8
|
+
require "autoproj/reporter"
|
9
9
|
|
10
10
|
module Autoproj
|
11
11
|
module CLI
|
@@ -14,26 +14,24 @@ module Autoproj
|
|
14
14
|
Encoding.default_external = Encoding::UTF_8
|
15
15
|
|
16
16
|
argv = ARGV.find_all { |arg| arg != "--no-plugins" }
|
17
|
-
if argv.size == ARGV.size
|
18
|
-
Autoproj::CLI.load_plugins
|
19
|
-
end
|
17
|
+
Autoproj::CLI.load_plugins if argv.size == ARGV.size
|
20
18
|
argv
|
21
19
|
end
|
22
20
|
|
23
21
|
class Main < Thor
|
24
22
|
class_option :verbose, type: :boolean, default: false,
|
25
|
-
|
23
|
+
desc: "turns verbose output"
|
26
24
|
class_option :debug, type: :boolean, default: false,
|
27
|
-
|
25
|
+
desc: "turns debugging output"
|
28
26
|
class_option :silent, type: :boolean, default: false,
|
29
|
-
|
27
|
+
desc: "tell autoproj to not display anything"
|
30
28
|
class_option :color, type: :boolean, default: TTY::Color.color?,
|
31
|
-
|
29
|
+
desc: "enables or disables colored display (enabled by default if the terminal supports it)"
|
32
30
|
class_option :progress, type: :boolean, default: TTY::Color.color?,
|
33
|
-
|
34
|
-
class_option
|
35
|
-
|
36
|
-
|
31
|
+
desc: "enables or disables progress display (enabled by default if the terminal supports it)"
|
32
|
+
class_option "interactive", type: :boolean,
|
33
|
+
default: (ENV["AUTOPROJ_NONINTERACTIVE"] != "1"),
|
34
|
+
desc: "tell autoproj to run (non)interactively"
|
37
35
|
|
38
36
|
stop_on_unknown_option! :exec
|
39
37
|
check_unknown_options! except: :exec
|
@@ -109,7 +107,8 @@ module Autoproj
|
|
109
107
|
flags = []
|
110
108
|
%i[color progress debug interactive].each do |option|
|
111
109
|
if options[option] then flags << "--#{option}"
|
112
|
-
else
|
110
|
+
else
|
111
|
+
flags << "--no-#{option}"
|
113
112
|
end
|
114
113
|
end
|
115
114
|
flags
|
@@ -117,7 +116,8 @@ module Autoproj
|
|
117
116
|
|
118
117
|
def run_autoproj_cli(filename, classname, report_options, *args, tool_failure_mode: :exit_silent, **extra_options)
|
119
118
|
require "autoproj/cli/#{filename}"
|
120
|
-
if
|
119
|
+
if options[:tool]
|
120
|
+
Autobuild::Subprocess.transparent_mode = true
|
121
121
|
Autobuild.silent = true
|
122
122
|
Autobuild.color = false
|
123
123
|
report_options[:silent] = true
|
@@ -129,169 +129,170 @@ module Autoproj
|
|
129
129
|
options = self.options.dup
|
130
130
|
# We use --local on the CLI but the APIs are expecting
|
131
131
|
# only_local
|
132
|
-
if options.has_key?(
|
133
|
-
options[:only_local] = options.delete(
|
132
|
+
if options.has_key?("local")
|
133
|
+
options[:only_local] = options.delete("local")
|
134
134
|
end
|
135
135
|
cli = CLI.const_get(classname).new
|
136
136
|
begin
|
137
|
-
run_args = cli.validate_options(args, options.merge(extra_options))
|
138
|
-
|
137
|
+
*run_args, kw = cli.validate_options(args, options.merge(extra_options))
|
138
|
+
kw = (kw || {}).transform_keys(&:to_sym)
|
139
|
+
cli.run(*run_args, **kw)
|
139
140
|
ensure
|
140
|
-
|
141
|
+
if cli.respond_to?(:notify_env_sh_updated)
|
142
|
+
cli.notify_env_sh_updated
|
143
|
+
end
|
141
144
|
end
|
142
145
|
end
|
143
146
|
end
|
144
147
|
end
|
145
148
|
|
146
|
-
desc
|
147
|
-
option :reuse, banner:
|
148
|
-
|
149
|
-
option :seed_config, banner:
|
150
|
-
|
149
|
+
desc "bootstrap VCS_TYPE VCS_URL VCS_OPTIONS", "bootstraps a new autoproj installation. This is usually not called directly, but called from the autoproj_bootstrap standalone script"
|
150
|
+
option :reuse, banner: "DIR",
|
151
|
+
desc: "reuse packages already built within the DIR autoproj workspace in this installation, if DIR is not given, reuses the installation whose env.sh is currently sourced"
|
152
|
+
option :seed_config, banner: "SEED_CONFIG",
|
153
|
+
desc: "a configuration file used to seed the bootstrap's configuration"
|
151
154
|
def bootstrap(*args)
|
152
|
-
|
153
|
-
require
|
155
|
+
unless File.directory?(File.join(Dir.pwd, ".autoproj"))
|
156
|
+
require "autoproj/ops/install"
|
154
157
|
ops = Autoproj::Ops::Install.new(Dir.pwd)
|
155
158
|
bootstrap_options = ops.parse_options(thor_options_to_optparse + args)
|
156
159
|
ops.run
|
157
|
-
exec Gem.ruby, $0,
|
160
|
+
exec Gem.ruby, $0, "bootstrap", *bootstrap_options
|
158
161
|
end
|
159
162
|
run_autoproj_cli(:bootstrap, :Bootstrap, Hash[], *args)
|
160
163
|
end
|
161
164
|
|
162
|
-
desc
|
165
|
+
desc "envsh", "update the environment files"
|
163
166
|
def envsh
|
164
167
|
run_autoproj_cli(:envsh, :Envsh, Hash[])
|
165
168
|
end
|
166
169
|
|
167
|
-
desc
|
170
|
+
desc "watch", "watch workspace for changes", hide: true
|
168
171
|
option :show_events, type: :boolean, default: false,
|
169
|
-
|
172
|
+
desc: "whether detected events should be displayed"
|
170
173
|
def watch
|
171
174
|
run_autoproj_cli(:watch, :Watch, Hash[])
|
172
175
|
end
|
173
176
|
|
174
|
-
desc
|
177
|
+
desc "status [PACKAGES]", "displays synchronization status between this workspace and the package(s) source"
|
175
178
|
option :local, type: :boolean, default: false,
|
176
|
-
|
179
|
+
desc: "only use locally available information (mainly for distributed version control systems such as git)"
|
177
180
|
option :mainline, type: :string,
|
178
|
-
|
181
|
+
desc: "compare to the given baseline. if 'true', the comparison will ignore any override, otherwise it will take into account overrides only up to the given package set"
|
179
182
|
option :snapshot, type: :boolean, default: false,
|
180
|
-
|
183
|
+
desc: "use the VCS information as 'versions --no-local' would detect it instead of the one in the configuration"
|
181
184
|
option :parallel, aliases: :p, type: :numeric,
|
182
|
-
|
185
|
+
desc: "maximum number of parallel jobs"
|
183
186
|
option :deps, type: :boolean, default: true,
|
184
|
-
|
185
|
-
option :no_deps_shortcut, hide: true, aliases:
|
186
|
-
|
187
|
+
desc: "whether only the status of the given packages should be displayed, or of their dependencies as well. -n is a shortcut for --no-deps"
|
188
|
+
option :no_deps_shortcut, hide: true, aliases: "-n", type: :boolean,
|
189
|
+
desc: "provide -n for --no-deps"
|
187
190
|
def status(*packages)
|
188
191
|
run_autoproj_cli(:status, :Status, Hash[], *packages)
|
189
192
|
end
|
190
193
|
|
191
|
-
desc
|
194
|
+
desc "update [PACKAGES]", "update packages"
|
192
195
|
option :aup, default: false, hide: true, type: :boolean,
|
193
|
-
|
196
|
+
desc: "behave like aup"
|
194
197
|
option :all, default: false, hide: true, type: :boolean,
|
195
|
-
|
196
|
-
option :keep_going, aliases: :k, type: :boolean, banner:
|
197
|
-
|
198
|
+
desc: "when in aup mode, update all packages instead of only the local one"
|
199
|
+
option :keep_going, aliases: :k, type: :boolean, banner: "",
|
200
|
+
desc: "do not stop on build or checkout errors"
|
198
201
|
option :config, type: :boolean,
|
199
|
-
|
202
|
+
desc: "(do not) update configuration. The default is to update configuration if explicitely selected or if no additional arguments are given on the command line, and to not do it if packages are explicitely selected on the command line"
|
200
203
|
option :bundler, type: :boolean,
|
201
|
-
|
204
|
+
desc: "(do not) update bundler. This is automatically enabled only if no arguments are given on the command line"
|
202
205
|
option :autoproj, type: :boolean,
|
203
|
-
|
206
|
+
desc: "(do not) update autoproj. This is automatically enabled only if no arguments are given on the command line"
|
204
207
|
option :osdeps, type: :boolean, default: true,
|
205
|
-
|
208
|
+
desc: "enable or disable osdeps handling"
|
206
209
|
option :from, type: :string,
|
207
|
-
|
210
|
+
desc: "use this existing autoproj installation to check out the packages (for importers that support this)"
|
208
211
|
option :checkout_only, aliases: :c, type: :boolean, default: false,
|
209
|
-
|
212
|
+
desc: "only checkout packages, do not update existing ones"
|
210
213
|
option :local, type: :boolean, default: false,
|
211
|
-
|
214
|
+
desc: "use only local information for the update (for importers that support it)"
|
212
215
|
option :osdeps_filter_uptodate, default: true, type: :boolean,
|
213
|
-
|
216
|
+
desc: "controls whether the osdeps subsystem should filter up-to-date packages or not"
|
214
217
|
option :deps, default: true, type: :boolean,
|
215
|
-
|
216
|
-
option :no_deps_shortcut, hide: true, aliases:
|
217
|
-
|
218
|
+
desc: "whether the package dependencies should be recursively updated (the default) or not. -n is a shortcut for --no-deps"
|
219
|
+
option :no_deps_shortcut, hide: true, aliases: "-n", type: :boolean,
|
220
|
+
desc: "provide -n for --no-deps"
|
218
221
|
option :reset, default: false, type: :boolean,
|
219
|
-
|
220
|
-
|
222
|
+
desc: "forcefully resets the repository to the state expected by autoproj's configuration",
|
223
|
+
long_desc: "The default is to update the repository if possible, and leave it alone otherwise. With --reset, autoproj update might come back to an older commit than the repository's current state"
|
221
224
|
option :force_reset, default: false, type: :boolean,
|
222
|
-
|
225
|
+
desc: "like --reset, but bypasses tests that ensure you won't lose data"
|
223
226
|
option :retry_count, default: nil, type: :numeric,
|
224
|
-
|
227
|
+
desc: "force the importer's retry count to this value"
|
225
228
|
option :parallel, aliases: :p, type: :numeric,
|
226
|
-
|
229
|
+
desc: "maximum number of parallel jobs"
|
227
230
|
option :mainline, type: :string,
|
228
|
-
|
231
|
+
desc: "compare to the given baseline. if 'true', the comparison will ignore any override, otherwise it will take into account overrides only up to the given package set"
|
229
232
|
option :auto_exclude, type: :boolean,
|
230
|
-
|
233
|
+
desc: "if true, packages that fail to import will be excluded from the build"
|
234
|
+
option :ask, type: :boolean, default: false,
|
235
|
+
desc: "ask whether each package should or should not be updated"
|
231
236
|
def update(*packages)
|
232
237
|
report_options = Hash[silent: false, on_package_failures: default_report_on_package_failures]
|
233
|
-
if options[:auto_exclude]
|
234
|
-
report_options[:on_package_failures] = :report
|
235
|
-
end
|
238
|
+
report_options[:on_package_failures] = :report if options[:auto_exclude]
|
236
239
|
|
237
240
|
run_autoproj_cli(:update, :Update, report_options, *packages, run_hook: true)
|
238
241
|
end
|
239
242
|
|
240
|
-
desc
|
243
|
+
desc "build [PACKAGES]", "build packages"
|
241
244
|
option :amake, default: false, hide: true, type: :boolean,
|
242
|
-
|
245
|
+
desc: "behave like amake"
|
243
246
|
option :all, default: false, hide: true, type: :boolean,
|
244
|
-
|
247
|
+
desc: "when in amake mode, build all packages instead of only the local one"
|
245
248
|
option :keep_going, aliases: :k, type: :boolean, default: false,
|
246
|
-
|
249
|
+
desc: "do not stop on build or checkout errors"
|
247
250
|
option :force, type: :boolean, default: false,
|
248
|
-
|
251
|
+
desc: "force reconfiguration-build cycle on the requested packages, even if they do not seem to need it"
|
249
252
|
option :rebuild, type: :boolean, default: false,
|
250
|
-
|
253
|
+
desc: "clean and build the requested packages"
|
251
254
|
option :osdeps, type: :boolean,
|
252
|
-
|
255
|
+
desc: "controls whether missing osdeps should be installed. In rebuild mode, also controls whether the osdeps should be reinstalled or not (the default is to reinstall them)"
|
253
256
|
option :deps, type: :boolean,
|
254
|
-
|
255
|
-
|
257
|
+
desc: "controls whether the operation should apply to the package's dependencies as well. -n is a shortcut for --no-deps",
|
258
|
+
long_desc: <<-EOD
|
256
259
|
Without --force or --rebuild, the default is true (the build will apply to all packages).
|
257
260
|
With --force or --rebuild, control whether the force/rebuild action should apply
|
258
261
|
only on the packages given on the command line, or on their dependencies as well.
|
259
262
|
In this case, the default is false
|
260
|
-
|
261
|
-
option :no_deps_shortcut, hide: true, aliases:
|
262
|
-
|
263
|
+
EOD
|
264
|
+
option :no_deps_shortcut, hide: true, aliases: "-n", type: :boolean,
|
265
|
+
desc: "provide -n for --no-deps"
|
263
266
|
option :parallel, aliases: :p, type: :numeric,
|
264
|
-
|
267
|
+
desc: "maximum number of parallel jobs"
|
265
268
|
option :auto_exclude, type: :boolean,
|
266
|
-
|
269
|
+
desc: "if true, packages that fail to import will be excluded from the build"
|
267
270
|
option :tool, type: :boolean,
|
268
|
-
|
271
|
+
desc: "act as a build tool, transparently passing the subcommand's outputs to STDOUT"
|
269
272
|
option :confirm, type: :boolean, default: nil,
|
270
|
-
|
273
|
+
desc: "--force and --rebuild will ask confirmation if applied to the whole workspace. Use --no-confirm to disable this confirmation"
|
271
274
|
option :not, type: :array, default: nil,
|
272
|
-
|
275
|
+
desc: "do not build the packages listed"
|
273
276
|
def build(*packages)
|
274
277
|
report_options = Hash[silent: false, on_package_failures: default_report_on_package_failures]
|
275
|
-
if options[:auto_exclude]
|
276
|
-
report_options[:on_package_failures] = :report
|
277
|
-
end
|
278
|
+
report_options[:on_package_failures] = :report if options[:auto_exclude]
|
278
279
|
|
279
280
|
failures = run_autoproj_cli(:build, :Build, report_options, *packages,
|
280
|
-
|
281
|
-
|
281
|
+
tool_failure_mode: :report_silent)
|
282
|
+
unless failures.empty?
|
282
283
|
Autobuild.silent = false
|
283
284
|
package_failures, config_failures = failures.partition do |e|
|
284
285
|
e.respond_to?(:target) && e.target.respond_to?(:name)
|
285
286
|
end
|
286
287
|
|
287
|
-
packages_failed = package_failures
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
Autobuild.error "#{packages_failed.size} packages failed: #{packages_failed.sort.join(
|
288
|
+
packages_failed = package_failures
|
289
|
+
.map do |e|
|
290
|
+
if e.respond_to?(:target) && e.target.respond_to?(:name)
|
291
|
+
e.target.name
|
292
|
+
end
|
293
|
+
end.compact
|
294
|
+
unless packages_failed.empty?
|
295
|
+
Autobuild.error "#{packages_failed.size} packages failed: #{packages_failed.sort.join(', ')}"
|
295
296
|
end
|
296
297
|
config_failures.each do |e|
|
297
298
|
Autobuild.error(e)
|
@@ -300,39 +301,39 @@ In this case, the default is false
|
|
300
301
|
end
|
301
302
|
end
|
302
303
|
|
303
|
-
desc
|
304
|
-
|
304
|
+
desc "cache CACHE_DIR", "create or update a cache directory that "\
|
305
|
+
"can be given to AUTOBUILD_CACHE_DIR"
|
305
306
|
option :keep_going,
|
306
307
|
aliases: :k,
|
307
|
-
desc:
|
308
|
+
desc: "do not stop on errors"
|
308
309
|
option :checkout_only,
|
309
310
|
aliases: :c, type: :boolean, default: false,
|
310
|
-
desc:
|
311
|
+
desc: "only checkout packages, do not update already-cached ones"
|
311
312
|
option :all,
|
312
313
|
type: :boolean, default: true,
|
313
|
-
desc:
|
314
|
-
|
314
|
+
desc: "cache all defined packages (the default), "\
|
315
|
+
" or only the selected ones"
|
315
316
|
option :packages,
|
316
317
|
type: :boolean, default: true,
|
317
|
-
desc:
|
318
|
+
desc: "update the package cache"
|
318
319
|
option :gems,
|
319
320
|
type: :boolean, default: false,
|
320
|
-
desc:
|
321
|
+
desc: "update the gems cache"
|
321
322
|
option :gems_compile_force,
|
322
323
|
type: :boolean, default: false,
|
323
|
-
desc:
|
324
|
+
desc: "with --gems-compile, recompile existing gems as well"
|
324
325
|
option :gems_compile,
|
325
326
|
type: :array,
|
326
|
-
desc:
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
327
|
+
desc: "pre-compile the following gems. This requires gem-compiler "\
|
328
|
+
"to be available in the workspace. Use GEM_NAME+ARTIFACT"\
|
329
|
+
"[+ARTIFACT] to add files or directories to the precompiled "\
|
330
|
+
"gems beyond what gem-compiler auto-adds (which is mostly "\
|
331
|
+
"dynamic libraries)"
|
331
332
|
def cache(*args)
|
332
333
|
run_autoproj_cli(:cache, :Cache, Hash[], *args)
|
333
334
|
end
|
334
335
|
|
335
|
-
desc
|
336
|
+
desc "clean [PACKAGES]", "remove build byproducts for the given packages"
|
336
337
|
long_desc <<-EODESC
|
337
338
|
Remove build byproducts from disk
|
338
339
|
|
@@ -347,72 +348,72 @@ In this case, the default is false
|
|
347
348
|
these defaults.
|
348
349
|
EODESC
|
349
350
|
option :deps, type: :boolean,
|
350
|
-
|
351
|
+
desc: "clean the given packages as well as their dependencies"
|
351
352
|
option :all, type: :boolean,
|
352
|
-
|
353
|
+
desc: "bypass the safety question when you mean to clean all packages"
|
353
354
|
def clean(*packages)
|
354
355
|
run_autoproj_cli(:clean, :Clean, Hash[], *packages)
|
355
356
|
end
|
356
357
|
|
357
|
-
desc
|
358
|
+
desc "locate [PACKAGE]", "return the path to the given package, or the path to the root if no packages are given on the command line"
|
358
359
|
option :cache, type: :boolean,
|
359
|
-
|
360
|
+
desc: "controls whether the resolution should be done by loading the whole configuration (false, slow) or through a cache file (the default)"
|
360
361
|
option :prefix, aliases: :p, type: :boolean,
|
361
|
-
|
362
|
+
desc: "outputs the package's prefix directory instead of its source directory"
|
362
363
|
option :build, aliases: :b, type: :boolean,
|
363
|
-
|
364
|
+
desc: "outputs the package's build directory instead of its source directory"
|
364
365
|
option :log, aliases: :l,
|
365
|
-
|
366
|
+
desc: "outputs the path to a package's log file"
|
366
367
|
def locate(*packages)
|
367
368
|
run_autoproj_cli(:locate, :Locate, Hash[], *packages)
|
368
369
|
end
|
369
370
|
|
370
|
-
desc
|
371
|
+
desc "reconfigure", "pass through all configuration questions"
|
371
372
|
option :separate_prefixes, type: :boolean,
|
372
|
-
|
373
|
+
desc: "sets or clears autoproj's separate prefixes mode"
|
373
374
|
def reconfigure
|
374
375
|
run_autoproj_cli(:reconfigure, :Reconfigure, Hash[])
|
375
376
|
end
|
376
377
|
|
377
|
-
desc
|
378
|
-
subcommand
|
378
|
+
desc "test", "interface for running tests"
|
379
|
+
subcommand "test", MainTest
|
379
380
|
|
380
|
-
desc
|
381
|
-
subcommand
|
381
|
+
desc "doc", "interface for generating documentation"
|
382
|
+
subcommand "doc", MainDoc
|
382
383
|
|
383
|
-
desc
|
384
|
+
desc "show [PACKAGES]", "show informations about package(s)"
|
384
385
|
option :mainline, type: :string,
|
385
|
-
|
386
|
+
desc: "compare to the given baseline. if 'true', the comparison will ignore any override, otherwise it will take into account overrides only up to the given package set"
|
386
387
|
option :env, type: :boolean,
|
387
|
-
|
388
|
+
desc: "display the package's own environment", default: false
|
388
389
|
option :short,
|
389
|
-
|
390
|
+
desc: "display a package summary with one package line"
|
390
391
|
option :recursive, type: :boolean, default: false,
|
391
|
-
|
392
|
+
desc: "display the package and their dependencies (the default is to only display selected packages)"
|
392
393
|
def show(*packages)
|
393
394
|
run_autoproj_cli(:show, :Show, Hash[], *packages)
|
394
395
|
end
|
395
396
|
|
396
|
-
desc
|
397
|
+
desc "osdeps [PACKAGES]", "install/update OS dependencies that are required by the given package (or for the whole installation if no packages are given"
|
397
398
|
option :system_info, type: :boolean,
|
398
|
-
|
399
|
+
desc: "show information about the osdep system and quit"
|
399
400
|
option :update, type: :boolean, default: true,
|
400
|
-
|
401
|
+
desc: "whether already installed packages should be updated or not"
|
401
402
|
def osdeps(*packages)
|
402
403
|
run_autoproj_cli(:osdeps, :OSDeps, Hash[silent: options[:system_info]], *packages)
|
403
404
|
end
|
404
405
|
|
405
|
-
desc
|
406
|
-
option :deps, type: :boolean, default: false, banner:
|
407
|
-
|
406
|
+
desc "version", "display the current version of autobuild and optionally with dependencies"
|
407
|
+
option :deps, type: :boolean, default: false, banner: "",
|
408
|
+
desc: "controls whether to list dependant gems as well"
|
408
409
|
def version(*args)
|
409
410
|
run_autoproj_cli(:version, :Version, Hash[], *args)
|
410
411
|
end
|
411
412
|
|
412
|
-
desc
|
413
|
-
option :config, type: :boolean, default: nil, banner:
|
414
|
-
|
415
|
-
|
413
|
+
desc "versions [PACKAGES]", "generate a version file for the given packages, or all packages if none are given"
|
414
|
+
option :config, type: :boolean, default: nil, banner: "",
|
415
|
+
desc: "controls whether the package sets should be versioned as well",
|
416
|
+
long_desc: <<-EOD
|
416
417
|
This is the default if no packages are given on the command line, or if the
|
417
418
|
autoproj main configuration directory is. Note that if --config but no packages
|
418
419
|
are given, the packages will not be versioned. In other words,
|
@@ -420,65 +421,65 @@ are given, the packages will not be versioned. In other words,
|
|
420
421
|
autoproj versions --config # versions only the configuration
|
421
422
|
autoproj versions autoproj/ # versions only the configuration
|
422
423
|
autoproj versions autoproj a/package # versions the configuration and the specified package(s)
|
423
|
-
|
424
|
-
option :keep_going, aliases: :k, type: :boolean, default: false, banner:
|
425
|
-
|
424
|
+
EOD
|
425
|
+
option :keep_going, aliases: :k, type: :boolean, default: false, banner: "",
|
426
|
+
desc: "do not stop if some package cannot be versioned"
|
426
427
|
option :replace, type: :boolean, default: false,
|
427
|
-
|
428
|
+
desc: "in combination with --save, controls whether an existing file should be updated or replaced"
|
428
429
|
option :deps, type: :boolean, default: false,
|
429
|
-
|
430
|
+
desc: "whether both packages and their dependencies should be versioned, or only the selected packages (the latter is the default)"
|
430
431
|
option :local, type: :boolean, default: false,
|
431
|
-
|
432
|
+
desc: "whether we should access the remote server to verify that the snapshotted state is present"
|
432
433
|
option :save, type: :string,
|
433
|
-
|
434
|
+
desc: "save to the given file instead of displaying it on the standard output"
|
434
435
|
option :fingerprint, type: :boolean, default: false,
|
435
|
-
|
436
|
+
desc: "calculate unique fingerprint for each package"
|
436
437
|
def versions(*packages)
|
437
438
|
run_autoproj_cli(:versions, :Versions, Hash[], *packages, deps: true)
|
438
439
|
end
|
439
440
|
|
440
441
|
stop_on_unknown_option! :log
|
441
|
-
desc
|
442
|
+
desc "log [REF]", "shows the log of autoproj updates"
|
442
443
|
option :since, type: :string, default: nil,
|
443
|
-
|
444
|
+
desc: "show what got updated since the given version"
|
444
445
|
option :diff, type: :boolean, default: false,
|
445
|
-
|
446
|
+
desc: "show the difference between two stages in the log"
|
446
447
|
def log(*args)
|
447
448
|
run_autoproj_cli(:log, :Log, Hash[], *args)
|
448
449
|
end
|
449
450
|
|
450
|
-
desc
|
451
|
+
desc "reset VERSION_ID", "resets packages to the state stored in the required version"
|
451
452
|
long_desc <<-EOD
|
452
453
|
reset VERSION_ID will infer the state of packages from the state stored in the requested version,
|
453
454
|
and reset the packages to these versions. VERSION_ID can be:
|
454
455
|
- an autoproj log entry (e.g. autoproj@{10})
|
455
456
|
- a branch or tag from the autoproj main build configuration
|
456
|
-
EOD
|
457
|
+
EOD
|
457
458
|
option :freeze, type: :boolean, default: false,
|
458
|
-
|
459
|
+
desc: "whether the version we reset to should be saved in overrides.d or not"
|
459
460
|
def reset(version_id)
|
460
461
|
run_autoproj_cli(:reset, :Reset, Hash[], version_id)
|
461
462
|
end
|
462
463
|
|
463
|
-
desc
|
464
|
+
desc "tag [TAG_NAME] [PACKAGES]", "save the package current versions as a tag, or lists the available tags if given no arguments."
|
464
465
|
long_desc <<-EOD
|
465
466
|
The tag subcommand stores the state of all packages (or of the packages selected
|
466
467
|
on the command line) into a tag in the build configuration. This state can be
|
467
468
|
retrieved later on by using "autoproj reset"
|
468
469
|
|
469
470
|
If given no arguments, will list the existing tags
|
470
|
-
EOD
|
471
|
+
EOD
|
471
472
|
option :package_sets, type: :boolean,
|
472
|
-
|
473
|
-
option :keep_going, aliases: :k, type: :boolean, banner:
|
474
|
-
|
473
|
+
desc: "commit the package set state as well (enabled by default)"
|
474
|
+
option :keep_going, aliases: :k, type: :boolean, banner: "",
|
475
|
+
desc: "do not stop on build or checkout errors"
|
475
476
|
option :message, aliases: :m, type: :string,
|
476
|
-
|
477
|
+
desc: "the message to use for the new commit (the default is to mention the creation of the tag)"
|
477
478
|
def tag(tag_name = nil, *packages)
|
478
479
|
run_autoproj_cli(:tag, :Tag, Hash[], tag_name, *packages)
|
479
480
|
end
|
480
481
|
|
481
|
-
desc
|
482
|
+
desc "commit [TAG_NAME] [PACKAGES]", "save the package current versions as a new commit in the main build configuration"
|
482
483
|
long_desc <<-EOD
|
483
484
|
The commit subcommand stores the state of all packages (or of the packages
|
484
485
|
selected on the command line) into a new commit in the currently checked-out
|
@@ -486,20 +487,20 @@ branch of the build configuration. This state can be retrieved later on by using
|
|
486
487
|
"autoproj reset". If a TAG_NAME is provided, the commit will be tagged.
|
487
488
|
|
488
489
|
If given no arguments, will list the existing tags
|
489
|
-
EOD
|
490
|
+
EOD
|
490
491
|
option :package_sets, type: :boolean,
|
491
|
-
|
492
|
-
option :keep_going, aliases: :k, type: :boolean, banner:
|
493
|
-
|
492
|
+
desc: "commit the package set state as well (enabled by default)"
|
493
|
+
option :keep_going, aliases: :k, type: :boolean, banner: "",
|
494
|
+
desc: "do not stop on build or checkout errors"
|
494
495
|
option :tag, aliases: :t, type: :string,
|
495
|
-
|
496
|
+
desc: "the tag name to use"
|
496
497
|
option :message, aliases: :m, type: :string,
|
497
|
-
|
498
|
+
desc: "the message to use for the new commit (the default is to mention the creation of the tag)"
|
498
499
|
def commit(*packages)
|
499
500
|
run_autoproj_cli(:commit, :Commit, Hash[], *packages, deps: true)
|
500
501
|
end
|
501
502
|
|
502
|
-
desc
|
503
|
+
desc "switch-config VCS URL [OPTIONS]", "switches the main build configuration"
|
503
504
|
long_desc <<-EOD
|
504
505
|
Changes source of the main configuration that is checked out in autoproj/
|
505
506
|
|
@@ -523,7 +524,7 @@ option without deleting the folder. Simply omit the VCS type and URL:
|
|
523
524
|
run_autoproj_cli(:switch_config, :SwitchConfig, Hash[], *args)
|
524
525
|
end
|
525
526
|
|
526
|
-
desc
|
527
|
+
desc "query [QUERY]", "searches for packages matching a query string. With no query string, matches all packages."
|
527
528
|
long_desc <<-EOD
|
528
529
|
Finds packages that match query_string and displays information about them (one per line)
|
529
530
|
By default, only the package name is displayed. It can be customized with the --format option
|
@@ -548,78 +549,89 @@ The format is a string in which special values can be expanded using a $VARNAME
|
|
548
549
|
PREFIX: the full path to the package installation directory
|
549
550
|
EOD
|
550
551
|
option :search_all, type: :boolean,
|
551
|
-
|
552
|
+
desc: "search in all defined packages instead of only in those selected selected in the layout"
|
552
553
|
option :format, type: :string,
|
553
|
-
|
554
|
+
desc: "customize what should be displayed. See FORMAT SPECIFICATION above"
|
554
555
|
def query(query_string = nil)
|
555
556
|
run_autoproj_cli(:query, :Query, Hash[], *Array(query_string))
|
556
557
|
end
|
557
558
|
|
558
|
-
desc
|
559
|
-
|
559
|
+
desc "install_stage2 ROOT_DIR [ENVVAR=VALUE ...]", "used by autoproj_install to finalize the installation",
|
560
|
+
hide: true
|
560
561
|
def install_stage2(root_dir, *vars)
|
561
|
-
require
|
562
|
+
require "autoproj/ops/install"
|
562
563
|
ops = Autoproj::Ops::Install.new(root_dir)
|
563
564
|
ops.parse_options(thor_options_to_optparse)
|
564
565
|
ops.stage2(*vars)
|
565
566
|
end
|
566
567
|
|
567
|
-
desc
|
568
|
-
subcommand
|
568
|
+
desc "plugin", "interface to manage autoproj plugins"
|
569
|
+
subcommand "plugin", MainPlugin
|
569
570
|
|
570
|
-
desc
|
571
|
-
subcommand
|
571
|
+
desc "global", "global management of the known workspaces"
|
572
|
+
subcommand "global", MainGlobal
|
572
573
|
|
573
|
-
desc
|
574
|
-
|
574
|
+
desc "patch", "applies patches necessary for the selected package",
|
575
|
+
hide: true
|
575
576
|
def patch(*packages)
|
576
577
|
run_autoproj_cli(:patcher, :Patcher, Hash[], *packages, patch: true)
|
577
578
|
end
|
578
579
|
|
579
|
-
desc
|
580
|
-
|
580
|
+
desc "unpatch", "remove any patch applied on the selected package",
|
581
|
+
hide: true
|
581
582
|
def unpatch(*packages)
|
582
583
|
run_autoproj_cli(:patcher, :Patcher, Hash[], *packages, patch: false)
|
583
584
|
end
|
584
585
|
|
585
|
-
desc
|
586
|
+
desc "manifest", "select or displays the active manifest"
|
586
587
|
def manifest(*name)
|
587
588
|
run_autoproj_cli(:manifest, :Manifest, Hash[silent: true], *name)
|
588
589
|
end
|
589
590
|
|
590
|
-
desc
|
591
|
+
desc "exec", "runs a command, applying the workspace's environment first"
|
592
|
+
option :chdir, type: :string, default: nil,
|
593
|
+
desc: "change to this directory first. This is interpreted relatively "\
|
594
|
+
"to the folder specified by --package (if given)"
|
595
|
+
option :package, type: :string, default: nil,
|
596
|
+
desc: "interpret --chdir with respect to a package directory (or, "\
|
597
|
+
"if --chdir is not given, chdir to the package directory). Use "\
|
598
|
+
"PACKAGE or srcdir:PACKAGE for the source dir, builddir:PACKAGE "\
|
599
|
+
"for the build dir and prefix:PACKAGE for the prefix. If --chdir "\
|
600
|
+
"is not given, autoproj will chdir to this folder"
|
591
601
|
option :use_cache, type: :boolean, default: nil,
|
592
|
-
|
593
|
-
|
602
|
+
desc: "use the cached environment instead of "\
|
603
|
+
"loading the whole configuration"
|
594
604
|
def exec(*args)
|
595
|
-
require
|
596
|
-
Autoproj.report(
|
597
|
-
|
605
|
+
require "autoproj/cli/exec"
|
606
|
+
Autoproj.report(
|
607
|
+
on_package_failures: default_report_on_package_failures,
|
608
|
+
debug: options[:debug],
|
609
|
+
silent: true
|
610
|
+
) do
|
611
|
+
opts = {}
|
598
612
|
use_cache = options[:use_cache]
|
599
|
-
|
600
|
-
|
601
|
-
|
613
|
+
opts[:interactive] = options[:interactive]
|
614
|
+
opts[:chdir] = options[:chdir]
|
615
|
+
opts[:package] = options[:package]
|
616
|
+
opts[:use_cached_env] = use_cache unless use_cache.nil?
|
602
617
|
CLI::Exec.new.run(*args, **opts)
|
603
618
|
end
|
604
619
|
end
|
605
620
|
|
606
|
-
desc
|
607
|
-
|
621
|
+
desc "which", "resolves the full path to a command "\
|
622
|
+
" within the Autoproj workspace"
|
608
623
|
option :use_cache, type: :boolean, default: nil,
|
609
|
-
|
610
|
-
|
624
|
+
desc: "use the cached environment instead of "\
|
625
|
+
"loading the whole configuration"
|
611
626
|
def which(cmd)
|
612
|
-
require
|
627
|
+
require "autoproj/cli/which"
|
613
628
|
Autoproj.report(on_package_failures: default_report_on_package_failures, debug: options[:debug], silent: true) do
|
614
629
|
opts = Hash.new
|
615
630
|
use_cache = options[:use_cache]
|
616
|
-
|
617
|
-
opts[:use_cached_env] = use_cache
|
618
|
-
end
|
631
|
+
opts[:use_cached_env] = use_cache unless use_cache.nil?
|
619
632
|
CLI::Which.new.run(cmd, **opts)
|
620
633
|
end
|
621
634
|
end
|
622
635
|
end
|
623
636
|
end
|
624
637
|
end
|
625
|
-
|