autoproj 2.14.0 → 2.15.0
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 +22 -22
- data/bin/alocate +4 -4
- data/bin/alog +5 -7
- data/bin/amake +4 -4
- data/bin/aup +4 -4
- data/bin/autoproj +3 -3
- data/bin/autoproj_bootstrap +185 -182
- data/bin/autoproj_bootstrap.in +7 -8
- data/bin/autoproj_install +184 -181
- data/bin/autoproj_install.in +6 -7
- data/lib/autoproj/aruba_minitest.rb +6 -11
- data/lib/autoproj/autobuild.rb +5 -6
- data/lib/autoproj/autobuild_extensions/archive_importer.rb +10 -11
- data/lib/autoproj/autobuild_extensions/dsl.rb +38 -34
- data/lib/autoproj/autobuild_extensions/git.rb +27 -26
- data/lib/autoproj/autobuild_extensions/package.rb +23 -22
- 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 +213 -204
- 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 +45 -39
- 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 +35 -37
- data/lib/autoproj/cli/utility.rb +11 -10
- 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 +77 -84
- data/lib/autoproj/environment.rb +28 -13
- 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 +132 -130
- 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 +511 -506
- data/lib/autoproj/ops/import.rb +73 -63
- data/lib/autoproj/ops/install.rb +178 -174
- 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 +10 -10
- data/lib/autoproj/package_managers/bundler_manager.rb +147 -111
- 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 +20 -22
- 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 +32 -22
- 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 +27 -26
- data/lib/autoproj/package_selection.rb +187 -187
- data/lib/autoproj/package_set.rb +127 -113
- data/lib/autoproj/python.rb +55 -55
- data/lib/autoproj/query_base.rb +20 -14
- data/lib/autoproj/reporter.rb +19 -19
- data/lib/autoproj/repository_managers/apt.rb +101 -67
- data/lib/autoproj/repository_managers/unknown_os_manager.rb +3 -3
- 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 +127 -104
- data/lib/autoproj/variable_expansion.rb +7 -9
- data/lib/autoproj/vcs_definition.rb +35 -32
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj/workspace.rb +123 -107
- data/lib/autoproj/zsh_completion.rb +8 -9
- data/lib/autoproj.rb +53 -55
- data/samples/autoproj/init.rb +1 -2
- metadata +53 -51
- data/.travis.yml +0 -24
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,8 +129,8 @@ 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
|
@@ -138,163 +138,161 @@ module Autoproj
|
|
138
138
|
kw = (kw || {}).transform_keys(&:to_sym)
|
139
139
|
cli.run(*run_args, **kw)
|
140
140
|
ensure
|
141
|
-
|
141
|
+
if cli.respond_to?(:notify_env_sh_updated)
|
142
|
+
cli.notify_env_sh_updated
|
143
|
+
end
|
142
144
|
end
|
143
145
|
end
|
144
146
|
end
|
145
147
|
end
|
146
148
|
|
147
|
-
desc
|
148
|
-
option :reuse, banner:
|
149
|
-
|
150
|
-
option :seed_config, banner:
|
151
|
-
|
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"
|
152
154
|
def bootstrap(*args)
|
153
|
-
|
154
|
-
require
|
155
|
+
unless File.directory?(File.join(Dir.pwd, ".autoproj"))
|
156
|
+
require "autoproj/ops/install"
|
155
157
|
ops = Autoproj::Ops::Install.new(Dir.pwd)
|
156
158
|
bootstrap_options = ops.parse_options(thor_options_to_optparse + args)
|
157
159
|
ops.run
|
158
|
-
exec Gem.ruby, $0,
|
160
|
+
exec Gem.ruby, $0, "bootstrap", *bootstrap_options
|
159
161
|
end
|
160
162
|
run_autoproj_cli(:bootstrap, :Bootstrap, Hash[], *args)
|
161
163
|
end
|
162
164
|
|
163
|
-
desc
|
165
|
+
desc "envsh", "update the environment files"
|
164
166
|
def envsh
|
165
167
|
run_autoproj_cli(:envsh, :Envsh, Hash[])
|
166
168
|
end
|
167
169
|
|
168
|
-
desc
|
170
|
+
desc "watch", "watch workspace for changes", hide: true
|
169
171
|
option :show_events, type: :boolean, default: false,
|
170
|
-
|
172
|
+
desc: "whether detected events should be displayed"
|
171
173
|
def watch
|
172
174
|
run_autoproj_cli(:watch, :Watch, Hash[])
|
173
175
|
end
|
174
176
|
|
175
|
-
desc
|
177
|
+
desc "status [PACKAGES]", "displays synchronization status between this workspace and the package(s) source"
|
176
178
|
option :local, type: :boolean, default: false,
|
177
|
-
|
179
|
+
desc: "only use locally available information (mainly for distributed version control systems such as git)"
|
178
180
|
option :mainline, type: :string,
|
179
|
-
|
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"
|
180
182
|
option :snapshot, type: :boolean, default: false,
|
181
|
-
|
183
|
+
desc: "use the VCS information as 'versions --no-local' would detect it instead of the one in the configuration"
|
182
184
|
option :parallel, aliases: :p, type: :numeric,
|
183
|
-
|
185
|
+
desc: "maximum number of parallel jobs"
|
184
186
|
option :deps, type: :boolean, default: true,
|
185
|
-
|
186
|
-
option :no_deps_shortcut, hide: true, aliases:
|
187
|
-
|
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"
|
188
190
|
def status(*packages)
|
189
191
|
run_autoproj_cli(:status, :Status, Hash[], *packages)
|
190
192
|
end
|
191
193
|
|
192
|
-
desc
|
194
|
+
desc "update [PACKAGES]", "update packages"
|
193
195
|
option :aup, default: false, hide: true, type: :boolean,
|
194
|
-
|
196
|
+
desc: "behave like aup"
|
195
197
|
option :all, default: false, hide: true, type: :boolean,
|
196
|
-
|
197
|
-
option :keep_going, aliases: :k, type: :boolean, banner:
|
198
|
-
|
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"
|
199
201
|
option :config, type: :boolean,
|
200
|
-
|
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"
|
201
203
|
option :bundler, type: :boolean,
|
202
|
-
|
204
|
+
desc: "(do not) update bundler. This is automatically enabled only if no arguments are given on the command line"
|
203
205
|
option :autoproj, type: :boolean,
|
204
|
-
|
206
|
+
desc: "(do not) update autoproj. This is automatically enabled only if no arguments are given on the command line"
|
205
207
|
option :osdeps, type: :boolean, default: true,
|
206
|
-
|
208
|
+
desc: "enable or disable osdeps handling"
|
207
209
|
option :from, type: :string,
|
208
|
-
|
210
|
+
desc: "use this existing autoproj installation to check out the packages (for importers that support this)"
|
209
211
|
option :checkout_only, aliases: :c, type: :boolean, default: false,
|
210
|
-
|
212
|
+
desc: "only checkout packages, do not update existing ones"
|
211
213
|
option :local, type: :boolean, default: false,
|
212
|
-
|
214
|
+
desc: "use only local information for the update (for importers that support it)"
|
213
215
|
option :osdeps_filter_uptodate, default: true, type: :boolean,
|
214
|
-
|
216
|
+
desc: "controls whether the osdeps subsystem should filter up-to-date packages or not"
|
215
217
|
option :deps, default: true, type: :boolean,
|
216
|
-
|
217
|
-
option :no_deps_shortcut, hide: true, aliases:
|
218
|
-
|
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"
|
219
221
|
option :reset, default: false, type: :boolean,
|
220
|
-
|
221
|
-
|
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"
|
222
224
|
option :force_reset, default: false, type: :boolean,
|
223
|
-
|
225
|
+
desc: "like --reset, but bypasses tests that ensure you won't lose data"
|
224
226
|
option :retry_count, default: nil, type: :numeric,
|
225
|
-
|
227
|
+
desc: "force the importer's retry count to this value"
|
226
228
|
option :parallel, aliases: :p, type: :numeric,
|
227
|
-
|
229
|
+
desc: "maximum number of parallel jobs"
|
228
230
|
option :mainline, type: :string,
|
229
|
-
|
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"
|
230
232
|
option :auto_exclude, type: :boolean,
|
231
|
-
|
233
|
+
desc: "if true, packages that fail to import will be excluded from the build"
|
232
234
|
option :ask, type: :boolean, default: false,
|
233
|
-
|
235
|
+
desc: "ask whether each package should or should not be updated"
|
234
236
|
def update(*packages)
|
235
237
|
report_options = Hash[silent: false, on_package_failures: default_report_on_package_failures]
|
236
|
-
if options[:auto_exclude]
|
237
|
-
report_options[:on_package_failures] = :report
|
238
|
-
end
|
238
|
+
report_options[:on_package_failures] = :report if options[:auto_exclude]
|
239
239
|
|
240
240
|
run_autoproj_cli(:update, :Update, report_options, *packages, run_hook: true)
|
241
241
|
end
|
242
242
|
|
243
|
-
desc
|
243
|
+
desc "build [PACKAGES]", "build packages"
|
244
244
|
option :amake, default: false, hide: true, type: :boolean,
|
245
|
-
|
245
|
+
desc: "behave like amake"
|
246
246
|
option :all, default: false, hide: true, type: :boolean,
|
247
|
-
|
247
|
+
desc: "when in amake mode, build all packages instead of only the local one"
|
248
248
|
option :keep_going, aliases: :k, type: :boolean, default: false,
|
249
|
-
|
249
|
+
desc: "do not stop on build or checkout errors"
|
250
250
|
option :force, type: :boolean, default: false,
|
251
|
-
|
251
|
+
desc: "force reconfiguration-build cycle on the requested packages, even if they do not seem to need it"
|
252
252
|
option :rebuild, type: :boolean, default: false,
|
253
|
-
|
253
|
+
desc: "clean and build the requested packages"
|
254
254
|
option :osdeps, type: :boolean,
|
255
|
-
|
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)"
|
256
256
|
option :deps, type: :boolean,
|
257
|
-
|
258
|
-
|
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
|
259
259
|
Without --force or --rebuild, the default is true (the build will apply to all packages).
|
260
260
|
With --force or --rebuild, control whether the force/rebuild action should apply
|
261
261
|
only on the packages given on the command line, or on their dependencies as well.
|
262
262
|
In this case, the default is false
|
263
|
-
|
264
|
-
option :no_deps_shortcut, hide: true, aliases:
|
265
|
-
|
263
|
+
EOD
|
264
|
+
option :no_deps_shortcut, hide: true, aliases: "-n", type: :boolean,
|
265
|
+
desc: "provide -n for --no-deps"
|
266
266
|
option :parallel, aliases: :p, type: :numeric,
|
267
|
-
|
267
|
+
desc: "maximum number of parallel jobs"
|
268
268
|
option :auto_exclude, type: :boolean,
|
269
|
-
|
269
|
+
desc: "if true, packages that fail to import will be excluded from the build"
|
270
270
|
option :tool, type: :boolean,
|
271
|
-
|
271
|
+
desc: "act as a build tool, transparently passing the subcommand's outputs to STDOUT"
|
272
272
|
option :confirm, type: :boolean, default: nil,
|
273
|
-
|
273
|
+
desc: "--force and --rebuild will ask confirmation if applied to the whole workspace. Use --no-confirm to disable this confirmation"
|
274
274
|
option :not, type: :array, default: nil,
|
275
|
-
|
275
|
+
desc: "do not build the packages listed"
|
276
276
|
def build(*packages)
|
277
277
|
report_options = Hash[silent: false, on_package_failures: default_report_on_package_failures]
|
278
|
-
if options[:auto_exclude]
|
279
|
-
report_options[:on_package_failures] = :report
|
280
|
-
end
|
278
|
+
report_options[:on_package_failures] = :report if options[:auto_exclude]
|
281
279
|
|
282
280
|
failures = run_autoproj_cli(:build, :Build, report_options, *packages,
|
283
|
-
|
284
|
-
|
281
|
+
tool_failure_mode: :report_silent)
|
282
|
+
unless failures.empty?
|
285
283
|
Autobuild.silent = false
|
286
284
|
package_failures, config_failures = failures.partition do |e|
|
287
285
|
e.respond_to?(:target) && e.target.respond_to?(:name)
|
288
286
|
end
|
289
287
|
|
290
|
-
packages_failed = package_failures
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
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(', ')}"
|
298
296
|
end
|
299
297
|
config_failures.each do |e|
|
300
298
|
Autobuild.error(e)
|
@@ -303,39 +301,39 @@ In this case, the default is false
|
|
303
301
|
end
|
304
302
|
end
|
305
303
|
|
306
|
-
desc
|
307
|
-
|
304
|
+
desc "cache CACHE_DIR", "create or update a cache directory that "\
|
305
|
+
"can be given to AUTOBUILD_CACHE_DIR"
|
308
306
|
option :keep_going,
|
309
307
|
aliases: :k,
|
310
|
-
desc:
|
308
|
+
desc: "do not stop on errors"
|
311
309
|
option :checkout_only,
|
312
310
|
aliases: :c, type: :boolean, default: false,
|
313
|
-
desc:
|
311
|
+
desc: "only checkout packages, do not update already-cached ones"
|
314
312
|
option :all,
|
315
313
|
type: :boolean, default: true,
|
316
|
-
desc:
|
317
|
-
|
314
|
+
desc: "cache all defined packages (the default), "\
|
315
|
+
" or only the selected ones"
|
318
316
|
option :packages,
|
319
317
|
type: :boolean, default: true,
|
320
|
-
desc:
|
318
|
+
desc: "update the package cache"
|
321
319
|
option :gems,
|
322
320
|
type: :boolean, default: false,
|
323
|
-
desc:
|
321
|
+
desc: "update the gems cache"
|
324
322
|
option :gems_compile_force,
|
325
323
|
type: :boolean, default: false,
|
326
|
-
desc:
|
324
|
+
desc: "with --gems-compile, recompile existing gems as well"
|
327
325
|
option :gems_compile,
|
328
326
|
type: :array,
|
329
|
-
desc:
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
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)"
|
334
332
|
def cache(*args)
|
335
333
|
run_autoproj_cli(:cache, :Cache, Hash[], *args)
|
336
334
|
end
|
337
335
|
|
338
|
-
desc
|
336
|
+
desc "clean [PACKAGES]", "remove build byproducts for the given packages"
|
339
337
|
long_desc <<-EODESC
|
340
338
|
Remove build byproducts from disk
|
341
339
|
|
@@ -350,72 +348,72 @@ In this case, the default is false
|
|
350
348
|
these defaults.
|
351
349
|
EODESC
|
352
350
|
option :deps, type: :boolean,
|
353
|
-
|
351
|
+
desc: "clean the given packages as well as their dependencies"
|
354
352
|
option :all, type: :boolean,
|
355
|
-
|
353
|
+
desc: "bypass the safety question when you mean to clean all packages"
|
356
354
|
def clean(*packages)
|
357
355
|
run_autoproj_cli(:clean, :Clean, Hash[], *packages)
|
358
356
|
end
|
359
357
|
|
360
|
-
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"
|
361
359
|
option :cache, type: :boolean,
|
362
|
-
|
360
|
+
desc: "controls whether the resolution should be done by loading the whole configuration (false, slow) or through a cache file (the default)"
|
363
361
|
option :prefix, aliases: :p, type: :boolean,
|
364
|
-
|
362
|
+
desc: "outputs the package's prefix directory instead of its source directory"
|
365
363
|
option :build, aliases: :b, type: :boolean,
|
366
|
-
|
364
|
+
desc: "outputs the package's build directory instead of its source directory"
|
367
365
|
option :log, aliases: :l,
|
368
|
-
|
366
|
+
desc: "outputs the path to a package's log file"
|
369
367
|
def locate(*packages)
|
370
368
|
run_autoproj_cli(:locate, :Locate, Hash[], *packages)
|
371
369
|
end
|
372
370
|
|
373
|
-
desc
|
371
|
+
desc "reconfigure", "pass through all configuration questions"
|
374
372
|
option :separate_prefixes, type: :boolean,
|
375
|
-
|
373
|
+
desc: "sets or clears autoproj's separate prefixes mode"
|
376
374
|
def reconfigure
|
377
375
|
run_autoproj_cli(:reconfigure, :Reconfigure, Hash[])
|
378
376
|
end
|
379
377
|
|
380
|
-
desc
|
381
|
-
subcommand
|
378
|
+
desc "test", "interface for running tests"
|
379
|
+
subcommand "test", MainTest
|
382
380
|
|
383
|
-
desc
|
384
|
-
subcommand
|
381
|
+
desc "doc", "interface for generating documentation"
|
382
|
+
subcommand "doc", MainDoc
|
385
383
|
|
386
|
-
desc
|
384
|
+
desc "show [PACKAGES]", "show informations about package(s)"
|
387
385
|
option :mainline, type: :string,
|
388
|
-
|
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"
|
389
387
|
option :env, type: :boolean,
|
390
|
-
|
388
|
+
desc: "display the package's own environment", default: false
|
391
389
|
option :short,
|
392
|
-
|
390
|
+
desc: "display a package summary with one package line"
|
393
391
|
option :recursive, type: :boolean, default: false,
|
394
|
-
|
392
|
+
desc: "display the package and their dependencies (the default is to only display selected packages)"
|
395
393
|
def show(*packages)
|
396
394
|
run_autoproj_cli(:show, :Show, Hash[], *packages)
|
397
395
|
end
|
398
396
|
|
399
|
-
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"
|
400
398
|
option :system_info, type: :boolean,
|
401
|
-
|
399
|
+
desc: "show information about the osdep system and quit"
|
402
400
|
option :update, type: :boolean, default: true,
|
403
|
-
|
401
|
+
desc: "whether already installed packages should be updated or not"
|
404
402
|
def osdeps(*packages)
|
405
403
|
run_autoproj_cli(:osdeps, :OSDeps, Hash[silent: options[:system_info]], *packages)
|
406
404
|
end
|
407
405
|
|
408
|
-
desc
|
409
|
-
option :deps, type: :boolean, default: false, banner:
|
410
|
-
|
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"
|
411
409
|
def version(*args)
|
412
410
|
run_autoproj_cli(:version, :Version, Hash[], *args)
|
413
411
|
end
|
414
412
|
|
415
|
-
desc
|
416
|
-
option :config, type: :boolean, default: nil, banner:
|
417
|
-
|
418
|
-
|
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
|
419
417
|
This is the default if no packages are given on the command line, or if the
|
420
418
|
autoproj main configuration directory is. Note that if --config but no packages
|
421
419
|
are given, the packages will not be versioned. In other words,
|
@@ -423,65 +421,65 @@ are given, the packages will not be versioned. In other words,
|
|
423
421
|
autoproj versions --config # versions only the configuration
|
424
422
|
autoproj versions autoproj/ # versions only the configuration
|
425
423
|
autoproj versions autoproj a/package # versions the configuration and the specified package(s)
|
426
|
-
|
427
|
-
option :keep_going, aliases: :k, type: :boolean, default: false, banner:
|
428
|
-
|
424
|
+
EOD
|
425
|
+
option :keep_going, aliases: :k, type: :boolean, default: false, banner: "",
|
426
|
+
desc: "do not stop if some package cannot be versioned"
|
429
427
|
option :replace, type: :boolean, default: false,
|
430
|
-
|
428
|
+
desc: "in combination with --save, controls whether an existing file should be updated or replaced"
|
431
429
|
option :deps, type: :boolean, default: false,
|
432
|
-
|
430
|
+
desc: "whether both packages and their dependencies should be versioned, or only the selected packages (the latter is the default)"
|
433
431
|
option :local, type: :boolean, default: false,
|
434
|
-
|
432
|
+
desc: "whether we should access the remote server to verify that the snapshotted state is present"
|
435
433
|
option :save, type: :string,
|
436
|
-
|
434
|
+
desc: "save to the given file instead of displaying it on the standard output"
|
437
435
|
option :fingerprint, type: :boolean, default: false,
|
438
|
-
|
436
|
+
desc: "calculate unique fingerprint for each package"
|
439
437
|
def versions(*packages)
|
440
438
|
run_autoproj_cli(:versions, :Versions, Hash[], *packages, deps: true)
|
441
439
|
end
|
442
440
|
|
443
441
|
stop_on_unknown_option! :log
|
444
|
-
desc
|
442
|
+
desc "log [REF]", "shows the log of autoproj updates"
|
445
443
|
option :since, type: :string, default: nil,
|
446
|
-
|
444
|
+
desc: "show what got updated since the given version"
|
447
445
|
option :diff, type: :boolean, default: false,
|
448
|
-
|
446
|
+
desc: "show the difference between two stages in the log"
|
449
447
|
def log(*args)
|
450
448
|
run_autoproj_cli(:log, :Log, Hash[], *args)
|
451
449
|
end
|
452
450
|
|
453
|
-
desc
|
451
|
+
desc "reset VERSION_ID", "resets packages to the state stored in the required version"
|
454
452
|
long_desc <<-EOD
|
455
453
|
reset VERSION_ID will infer the state of packages from the state stored in the requested version,
|
456
454
|
and reset the packages to these versions. VERSION_ID can be:
|
457
455
|
- an autoproj log entry (e.g. autoproj@{10})
|
458
456
|
- a branch or tag from the autoproj main build configuration
|
459
|
-
EOD
|
457
|
+
EOD
|
460
458
|
option :freeze, type: :boolean, default: false,
|
461
|
-
|
459
|
+
desc: "whether the version we reset to should be saved in overrides.d or not"
|
462
460
|
def reset(version_id)
|
463
461
|
run_autoproj_cli(:reset, :Reset, Hash[], version_id)
|
464
462
|
end
|
465
463
|
|
466
|
-
desc
|
464
|
+
desc "tag [TAG_NAME] [PACKAGES]", "save the package current versions as a tag, or lists the available tags if given no arguments."
|
467
465
|
long_desc <<-EOD
|
468
466
|
The tag subcommand stores the state of all packages (or of the packages selected
|
469
467
|
on the command line) into a tag in the build configuration. This state can be
|
470
468
|
retrieved later on by using "autoproj reset"
|
471
469
|
|
472
470
|
If given no arguments, will list the existing tags
|
473
|
-
EOD
|
471
|
+
EOD
|
474
472
|
option :package_sets, type: :boolean,
|
475
|
-
|
476
|
-
option :keep_going, aliases: :k, type: :boolean, banner:
|
477
|
-
|
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"
|
478
476
|
option :message, aliases: :m, type: :string,
|
479
|
-
|
477
|
+
desc: "the message to use for the new commit (the default is to mention the creation of the tag)"
|
480
478
|
def tag(tag_name = nil, *packages)
|
481
479
|
run_autoproj_cli(:tag, :Tag, Hash[], tag_name, *packages)
|
482
480
|
end
|
483
481
|
|
484
|
-
desc
|
482
|
+
desc "commit [TAG_NAME] [PACKAGES]", "save the package current versions as a new commit in the main build configuration"
|
485
483
|
long_desc <<-EOD
|
486
484
|
The commit subcommand stores the state of all packages (or of the packages
|
487
485
|
selected on the command line) into a new commit in the currently checked-out
|
@@ -489,20 +487,20 @@ branch of the build configuration. This state can be retrieved later on by using
|
|
489
487
|
"autoproj reset". If a TAG_NAME is provided, the commit will be tagged.
|
490
488
|
|
491
489
|
If given no arguments, will list the existing tags
|
492
|
-
EOD
|
490
|
+
EOD
|
493
491
|
option :package_sets, type: :boolean,
|
494
|
-
|
495
|
-
option :keep_going, aliases: :k, type: :boolean, banner:
|
496
|
-
|
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"
|
497
495
|
option :tag, aliases: :t, type: :string,
|
498
|
-
|
496
|
+
desc: "the tag name to use"
|
499
497
|
option :message, aliases: :m, type: :string,
|
500
|
-
|
498
|
+
desc: "the message to use for the new commit (the default is to mention the creation of the tag)"
|
501
499
|
def commit(*packages)
|
502
500
|
run_autoproj_cli(:commit, :Commit, Hash[], *packages, deps: true)
|
503
501
|
end
|
504
502
|
|
505
|
-
desc
|
503
|
+
desc "switch-config VCS URL [OPTIONS]", "switches the main build configuration"
|
506
504
|
long_desc <<-EOD
|
507
505
|
Changes source of the main configuration that is checked out in autoproj/
|
508
506
|
|
@@ -526,7 +524,7 @@ option without deleting the folder. Simply omit the VCS type and URL:
|
|
526
524
|
run_autoproj_cli(:switch_config, :SwitchConfig, Hash[], *args)
|
527
525
|
end
|
528
526
|
|
529
|
-
desc
|
527
|
+
desc "query [QUERY]", "searches for packages matching a query string. With no query string, matches all packages."
|
530
528
|
long_desc <<-EOD
|
531
529
|
Finds packages that match query_string and displays information about them (one per line)
|
532
530
|
By default, only the package name is displayed. It can be customized with the --format option
|
@@ -551,78 +549,89 @@ The format is a string in which special values can be expanded using a $VARNAME
|
|
551
549
|
PREFIX: the full path to the package installation directory
|
552
550
|
EOD
|
553
551
|
option :search_all, type: :boolean,
|
554
|
-
|
552
|
+
desc: "search in all defined packages instead of only in those selected selected in the layout"
|
555
553
|
option :format, type: :string,
|
556
|
-
|
554
|
+
desc: "customize what should be displayed. See FORMAT SPECIFICATION above"
|
557
555
|
def query(query_string = nil)
|
558
556
|
run_autoproj_cli(:query, :Query, Hash[], *Array(query_string))
|
559
557
|
end
|
560
558
|
|
561
|
-
desc
|
562
|
-
|
559
|
+
desc "install_stage2 ROOT_DIR [ENVVAR=VALUE ...]", "used by autoproj_install to finalize the installation",
|
560
|
+
hide: true
|
563
561
|
def install_stage2(root_dir, *vars)
|
564
|
-
require
|
562
|
+
require "autoproj/ops/install"
|
565
563
|
ops = Autoproj::Ops::Install.new(root_dir)
|
566
564
|
ops.parse_options(thor_options_to_optparse)
|
567
565
|
ops.stage2(*vars)
|
568
566
|
end
|
569
567
|
|
570
|
-
desc
|
571
|
-
subcommand
|
568
|
+
desc "plugin", "interface to manage autoproj plugins"
|
569
|
+
subcommand "plugin", MainPlugin
|
572
570
|
|
573
|
-
desc
|
574
|
-
subcommand
|
571
|
+
desc "global", "global management of the known workspaces"
|
572
|
+
subcommand "global", MainGlobal
|
575
573
|
|
576
|
-
desc
|
577
|
-
|
574
|
+
desc "patch", "applies patches necessary for the selected package",
|
575
|
+
hide: true
|
578
576
|
def patch(*packages)
|
579
577
|
run_autoproj_cli(:patcher, :Patcher, Hash[], *packages, patch: true)
|
580
578
|
end
|
581
579
|
|
582
|
-
desc
|
583
|
-
|
580
|
+
desc "unpatch", "remove any patch applied on the selected package",
|
581
|
+
hide: true
|
584
582
|
def unpatch(*packages)
|
585
583
|
run_autoproj_cli(:patcher, :Patcher, Hash[], *packages, patch: false)
|
586
584
|
end
|
587
585
|
|
588
|
-
desc
|
586
|
+
desc "manifest", "select or displays the active manifest"
|
589
587
|
def manifest(*name)
|
590
588
|
run_autoproj_cli(:manifest, :Manifest, Hash[silent: true], *name)
|
591
589
|
end
|
592
590
|
|
593
|
-
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"
|
594
601
|
option :use_cache, type: :boolean, default: nil,
|
595
|
-
|
596
|
-
|
602
|
+
desc: "use the cached environment instead of "\
|
603
|
+
"loading the whole configuration"
|
597
604
|
def exec(*args)
|
598
|
-
require
|
599
|
-
Autoproj.report(
|
600
|
-
|
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 = {}
|
601
612
|
use_cache = options[:use_cache]
|
602
|
-
|
603
|
-
|
604
|
-
|
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?
|
605
617
|
CLI::Exec.new.run(*args, **opts)
|
606
618
|
end
|
607
619
|
end
|
608
620
|
|
609
|
-
desc
|
610
|
-
|
621
|
+
desc "which", "resolves the full path to a command "\
|
622
|
+
" within the Autoproj workspace"
|
611
623
|
option :use_cache, type: :boolean, default: nil,
|
612
|
-
|
613
|
-
|
624
|
+
desc: "use the cached environment instead of "\
|
625
|
+
"loading the whole configuration"
|
614
626
|
def which(cmd)
|
615
|
-
require
|
627
|
+
require "autoproj/cli/which"
|
616
628
|
Autoproj.report(on_package_failures: default_report_on_package_failures, debug: options[:debug], silent: true) do
|
617
629
|
opts = Hash.new
|
618
630
|
use_cache = options[:use_cache]
|
619
|
-
|
620
|
-
opts[:use_cached_env] = use_cache
|
621
|
-
end
|
631
|
+
opts[:use_cached_env] = use_cache unless use_cache.nil?
|
622
632
|
CLI::Which.new.run(cmd, **opts)
|
623
633
|
end
|
624
634
|
end
|
625
635
|
end
|
626
636
|
end
|
627
637
|
end
|
628
|
-
|