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.
- checksums.yaml +4 -4
- data/.gemtest +0 -0
- data/Manifest.txt +27 -21
- data/Rakefile +4 -6
- data/bin/alocate +5 -1
- data/bin/amake +3 -53
- data/bin/aup +3 -50
- data/bin/autoproj +3 -264
- data/bin/autoproj_bootstrap +294 -349
- data/bin/autoproj_bootstrap.in +27 -3
- data/lib/autoproj.rb +23 -1
- data/lib/autoproj/autobuild.rb +51 -89
- data/lib/autoproj/base.rb +0 -9
- data/lib/autoproj/build_option.rb +1 -3
- data/lib/autoproj/cli.rb +1 -0
- data/lib/autoproj/cli/base.rb +155 -0
- data/lib/autoproj/cli/bootstrap.rb +119 -0
- data/lib/autoproj/cli/build.rb +72 -0
- data/lib/autoproj/cli/cache.rb +31 -0
- data/lib/autoproj/cli/clean.rb +37 -0
- data/lib/autoproj/cli/commit.rb +41 -0
- data/lib/autoproj/cli/doc.rb +22 -0
- data/lib/autoproj/cli/envsh.rb +22 -0
- data/lib/autoproj/cli/inspection_tool.rb +73 -0
- data/lib/autoproj/cli/locate.rb +96 -0
- data/lib/autoproj/cli/log.rb +26 -0
- data/lib/autoproj/cli/main.rb +249 -0
- data/lib/autoproj/cli/main_test.rb +57 -0
- data/lib/autoproj/cli/osdeps.rb +30 -0
- data/lib/autoproj/cli/query.rb +43 -0
- data/lib/autoproj/cli/reconfigure.rb +19 -0
- data/lib/autoproj/cli/reset.rb +7 -32
- data/lib/autoproj/cli/show.rb +219 -0
- data/lib/autoproj/cli/snapshot.rb +1 -1
- data/lib/autoproj/cli/status.rb +149 -0
- data/lib/autoproj/cli/switch_config.rb +28 -0
- data/lib/autoproj/cli/tag.rb +9 -35
- data/lib/autoproj/cli/test.rb +34 -55
- data/lib/autoproj/cli/update.rb +158 -0
- data/lib/autoproj/cli/versions.rb +32 -69
- data/lib/autoproj/configuration.rb +95 -34
- data/lib/autoproj/default.osdeps +25 -35
- data/lib/autoproj/environment.rb +85 -63
- data/lib/autoproj/exceptions.rb +50 -0
- data/lib/autoproj/gitorious.rb +11 -9
- data/lib/autoproj/manifest.rb +199 -231
- data/lib/autoproj/metapackage.rb +0 -8
- data/lib/autoproj/ops/build.rb +1 -17
- data/lib/autoproj/ops/configuration.rb +92 -90
- data/lib/autoproj/ops/import.rb +222 -0
- data/lib/autoproj/ops/loader.rb +18 -8
- data/lib/autoproj/ops/main_config_switcher.rb +45 -73
- data/lib/autoproj/ops/snapshot.rb +5 -10
- data/lib/autoproj/ops/tools.rb +10 -44
- data/lib/autoproj/options.rb +35 -6
- data/lib/autoproj/osdeps.rb +97 -68
- data/lib/autoproj/package_selection.rb +39 -20
- data/lib/autoproj/package_set.rb +26 -24
- data/lib/autoproj/reporter.rb +91 -0
- data/lib/autoproj/system.rb +50 -149
- data/lib/autoproj/variable_expansion.rb +32 -6
- data/lib/autoproj/vcs_definition.rb +57 -17
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj/workspace.rb +550 -0
- data/test/ops/test_snapshot.rb +26 -0
- data/test/test_package.rb +30 -0
- data/test/test_vcs_definition.rb +46 -0
- metadata +55 -50
- data/bin/autolocate +0 -3
- data/bin/autoproj-bootstrap +0 -68
- data/bin/autoproj-cache +0 -18
- data/bin/autoproj-clean +0 -13
- data/bin/autoproj-commit +0 -10
- data/bin/autoproj-create-set +0 -118
- data/bin/autoproj-doc +0 -28
- data/bin/autoproj-envsh +0 -14
- data/bin/autoproj-list +0 -69
- data/bin/autoproj-locate +0 -85
- data/bin/autoproj-log +0 -5
- data/bin/autoproj-query +0 -82
- data/bin/autoproj-reset +0 -13
- data/bin/autoproj-show +0 -192
- data/bin/autoproj-snapshot +0 -27
- data/bin/autoproj-switch-config +0 -24
- data/bin/autoproj-tag +0 -13
- data/bin/autoproj-test +0 -31
- data/bin/autoproj-versions +0 -20
- data/bin/autoproj_stress_test +0 -40
- data/lib/autoproj/cmdline.rb +0 -1649
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'autoproj/cli/inspection_tool'
|
2
|
+
|
3
|
+
module Autoproj
|
4
|
+
module CLI
|
5
|
+
class Doc < InspectionTool
|
6
|
+
def run(selected_packages, options = Hash.new)
|
7
|
+
initialize_and_load
|
8
|
+
options = Kernel.validate_options options,
|
9
|
+
with_deps: true
|
10
|
+
|
11
|
+
selected_packages, _ =
|
12
|
+
normalize_command_line_package_selection(selected_packages)
|
13
|
+
package_names, _ = resolve_selection(selected_packages, recursive: options[:with_deps])
|
14
|
+
|
15
|
+
packages.each do |pkg|
|
16
|
+
ws.manifest.find_autobuild_package(pkg).disable_phases('import', 'prepare', 'install')
|
17
|
+
end
|
18
|
+
Autobuild.apply(packages, "autoproj-doc", ['doc'])
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'autoproj/cli/inspection_tool'
|
2
|
+
module Autoproj
|
3
|
+
module CLI
|
4
|
+
class Envsh < InspectionTool
|
5
|
+
def validate_options(_unused, options = Hash.new)
|
6
|
+
_, options = super(_unused, options)
|
7
|
+
options
|
8
|
+
end
|
9
|
+
|
10
|
+
def run(options = Hash.new)
|
11
|
+
initialize_and_load
|
12
|
+
finalize_setup(Array.new,
|
13
|
+
ignore_non_imported_packages: true)
|
14
|
+
|
15
|
+
options = Kernel.validate_options options,
|
16
|
+
shell_helpers: ws.config.shell_helpers?
|
17
|
+
ws.env.export_env_sh(shell_helpers: options[:shell_helpers])
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'autoproj/cli/base'
|
2
|
+
|
3
|
+
module Autoproj
|
4
|
+
module CLI
|
5
|
+
# Base class for CLI tools that do not change the state of the installed
|
6
|
+
# system
|
7
|
+
class InspectionTool < Base
|
8
|
+
def initialize_and_load(options = Hash.new)
|
9
|
+
options = Kernel.validate_options options,
|
10
|
+
mainline: nil
|
11
|
+
|
12
|
+
Autoproj.silent do
|
13
|
+
ws.setup
|
14
|
+
if mainline = options[:mainline]
|
15
|
+
if mainline == 'true'
|
16
|
+
mainline = true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
ws.load_package_sets(mainline: mainline)
|
20
|
+
ws.setup_all_package_directories
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# Finish loading the package information
|
25
|
+
#
|
26
|
+
# @param [Array<String>] packages the list of package names
|
27
|
+
# @option options ignore_non_imported_packages (true) whether
|
28
|
+
# packages that are not present on disk should be ignored (true in
|
29
|
+
# most cases)
|
30
|
+
# @option options recursive (true) whether the package resolution
|
31
|
+
# should return the package(s) and their dependencies
|
32
|
+
#
|
33
|
+
# @return [(Array<String>,PackageSelection,Boolean)] the list of
|
34
|
+
# selected packages, the PackageSelection representing the
|
35
|
+
# selection resolution itself, and a flag telling whether some of
|
36
|
+
# the arguments were pointing within the configuration area
|
37
|
+
def finalize_setup(packages = [], options = Hash.new)
|
38
|
+
options = Kernel.validate_options options,
|
39
|
+
ignore_non_imported_packages: true,
|
40
|
+
recursive: true
|
41
|
+
|
42
|
+
Autoproj.silent do
|
43
|
+
packages, config_selected = normalize_command_line_package_selection(packages)
|
44
|
+
# Call resolve_user_selection once to auto-add packages, so
|
45
|
+
# that they're available to e.g. overrides.rb
|
46
|
+
resolve_user_selection(packages)
|
47
|
+
ws.finalize_package_setup
|
48
|
+
source_packages, osdep_packages, resolved_selection =
|
49
|
+
resolve_selection(ws.manifest, packages, options)
|
50
|
+
ws.finalize_setup
|
51
|
+
ws.export_installation_manifest
|
52
|
+
return source_packages, osdep_packages, resolved_selection, config_selected
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def load_all_available_package_manifests
|
57
|
+
# Load the manifest for packages that are already present on the
|
58
|
+
# file system
|
59
|
+
ws.manifest.packages.each_value do |pkg|
|
60
|
+
if File.directory?(pkg.autobuild.srcdir)
|
61
|
+
begin
|
62
|
+
ws.manifest.load_package_manifest(pkg.autobuild.name)
|
63
|
+
rescue Interrupt
|
64
|
+
raise
|
65
|
+
rescue Exception => e
|
66
|
+
Autoproj.warn "cannot load package manifest for #{pkg.autobuild.name}: #{e.message}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
require 'autoproj'
|
2
|
+
require 'autoproj/cli/base'
|
3
|
+
|
4
|
+
module Autoproj
|
5
|
+
module CLI
|
6
|
+
class Locate < Base
|
7
|
+
class NotFound < RuntimeError; end
|
8
|
+
class AmbiguousSelection < RuntimeError; end
|
9
|
+
|
10
|
+
attr_reader :installation_manifest
|
11
|
+
|
12
|
+
def initialize(ws = nil)
|
13
|
+
super
|
14
|
+
|
15
|
+
@installation_manifest = Autoproj::InstallationManifest.new(self.ws.root_dir)
|
16
|
+
if !File.file?(installation_manifest.default_manifest_path)
|
17
|
+
raise ConfigError, "the installation manifest is not present, please run autoproj envsh to generate it"
|
18
|
+
end
|
19
|
+
installation_manifest.load
|
20
|
+
end
|
21
|
+
|
22
|
+
def validate_options(selected, options)
|
23
|
+
selected, options = super
|
24
|
+
return selected.first, options
|
25
|
+
end
|
26
|
+
|
27
|
+
def run(selection, options = Hash.new)
|
28
|
+
if !selection
|
29
|
+
puts ws.root_dir
|
30
|
+
return
|
31
|
+
end
|
32
|
+
|
33
|
+
selection_rx = Regexp.new(Regexp.quote(selection))
|
34
|
+
candidates = []
|
35
|
+
installation_manifest.each do |pkg|
|
36
|
+
name = pkg.name
|
37
|
+
srcdir = pkg.srcdir
|
38
|
+
if name == selection
|
39
|
+
puts srcdir
|
40
|
+
return
|
41
|
+
elsif name =~ selection_rx
|
42
|
+
candidates << srcdir
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
if candidates.empty?
|
47
|
+
# Try harder. Match directory prefixes
|
48
|
+
directories = selection.split('/')
|
49
|
+
rx = directories.
|
50
|
+
map { |d| "#{Regexp.quote(d)}\\w*" }.
|
51
|
+
join("/")
|
52
|
+
rx = Regexp.new(rx)
|
53
|
+
|
54
|
+
rx_strict = directories[0..-2].
|
55
|
+
map { |d| "#{Regexp.quote(d)}\\w*" }.
|
56
|
+
join("/")
|
57
|
+
rx_strict = Regexp.new("#{rx_strict}/#{Regexp.quote(directories.last)}$")
|
58
|
+
|
59
|
+
candidates_strict = []
|
60
|
+
installation_manifest.each do |pkg|
|
61
|
+
name = pkg.name
|
62
|
+
srcdir = pkg.srcdir
|
63
|
+
if name =~ rx
|
64
|
+
candidates << srcdir
|
65
|
+
end
|
66
|
+
if name =~ rx_strict
|
67
|
+
candidates_strict << srcdir
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
if candidates.size > 1 && candidates_strict.size == 1
|
72
|
+
candidates = candidates_strict
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
if candidates.size > 1
|
77
|
+
# If there is more than one candidate, check if there are some that are not
|
78
|
+
# present on disk
|
79
|
+
present = candidates.find_all { |dir| File.directory?(dir) }
|
80
|
+
if present.size == 1
|
81
|
+
candidates = present
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
if candidates.empty?
|
86
|
+
raise ArgumentError, "cannot find #{selection} in the current autoproj installation"
|
87
|
+
elsif candidates.size > 1
|
88
|
+
raise ArgumentError, "multiple packages match #{selection} in the current autoproj installation: #{candidates.join(", ")}"
|
89
|
+
else
|
90
|
+
puts candidates.first
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'autoproj'
|
2
|
+
require 'autoproj/cli/base'
|
3
|
+
|
4
|
+
module Autoproj
|
5
|
+
module CLI
|
6
|
+
class Log < Base
|
7
|
+
def run(args, options = Hash.new)
|
8
|
+
ws = Workspace.from_environment
|
9
|
+
ws.load_config
|
10
|
+
|
11
|
+
if !ws.config.import_log_enabled?
|
12
|
+
Autoproj.error "import log is disabled on this install"
|
13
|
+
return
|
14
|
+
elsif !Ops::Snapshot.update_log_available?(ws.manifest)
|
15
|
+
Autoproj.error "import log is not available on this install, the main build configuration repository is not using git"
|
16
|
+
return
|
17
|
+
end
|
18
|
+
|
19
|
+
exec(Autobuild.tool(:git), "--git-dir=#{ws.config_dir}/.git", 'reflog',
|
20
|
+
Ops::Snapshot.import_state_log_ref, '--format=%Cgreen%gd %Cblue%cr %Creset%gs',
|
21
|
+
*args)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
@@ -0,0 +1,249 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'autoproj'
|
3
|
+
require 'autoproj/cli/main_test'
|
4
|
+
|
5
|
+
module Autoproj
|
6
|
+
module CLI
|
7
|
+
def self.basic_setup
|
8
|
+
Encoding.default_internal = Encoding::UTF_8
|
9
|
+
Encoding.default_external = Encoding::UTF_8
|
10
|
+
|
11
|
+
Autobuild::Reporting << Autoproj::Reporter.new
|
12
|
+
Autobuild::Package.clear
|
13
|
+
end
|
14
|
+
|
15
|
+
class Main < Thor
|
16
|
+
class_option :verbose, type: :boolean,
|
17
|
+
desc: 'turns verbose output',
|
18
|
+
default: false
|
19
|
+
class_option :debug, type: :boolean,
|
20
|
+
desc: 'turns debugging output',
|
21
|
+
default: false
|
22
|
+
class_option :silent, type: :boolean,
|
23
|
+
desc: 'tell autoproj to not display anything',
|
24
|
+
default: false
|
25
|
+
class_option :progress, type: :boolean,
|
26
|
+
desc: 'enables or disables progress display (enabled by default)',
|
27
|
+
default: true
|
28
|
+
|
29
|
+
no_commands do
|
30
|
+
def run_autoproj_cli(filename, classname, report_options, *args)
|
31
|
+
require "autoproj/cli/#{filename}"
|
32
|
+
Autoproj.report(Hash[silent: true].merge(report_options)) do
|
33
|
+
cli = CLI.const_get(classname).new
|
34
|
+
run_args = cli.validate_options(args, self.options)
|
35
|
+
cli.run(*run_args)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
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'
|
41
|
+
option :reuse,
|
42
|
+
banner: 'DIR',
|
43
|
+
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'
|
44
|
+
def bootstrap(*args)
|
45
|
+
run_autoproj_cli(:bootstrap, :Bootstrap, Hash[], *args)
|
46
|
+
end
|
47
|
+
|
48
|
+
desc 'envsh', 'update the env.sh file'
|
49
|
+
def envsh
|
50
|
+
run_autoproj_cli(:envsh, :Envsh, Hash[])
|
51
|
+
end
|
52
|
+
|
53
|
+
desc 'status [PACKAGES]', 'displays synchronization status between this workspace and the package(s) source'
|
54
|
+
option :only_local,
|
55
|
+
desc: 'only use locally available information (mainly for distributed version control systems such as git)'
|
56
|
+
option :mainline, type: :string,
|
57
|
+
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"
|
58
|
+
def status(*packages)
|
59
|
+
run_autoproj_cli(:status, :Status, Hash[], *packages)
|
60
|
+
end
|
61
|
+
|
62
|
+
desc 'doc', 'generate API documentation for packages that support it'
|
63
|
+
option :without_deps, desc: 'generate documentation for the packages given on the command line, and not for their dependencies'
|
64
|
+
def doc(*packages)
|
65
|
+
run_autoproj_cli(:doc, :Doc, Hash[], *packages)
|
66
|
+
end
|
67
|
+
|
68
|
+
desc 'update', 'update packages'
|
69
|
+
option :aup, default: false, hide: true, type: :boolean,
|
70
|
+
desc: 'behave like aup'
|
71
|
+
option :all, default: false, hide: true, type: :boolean,
|
72
|
+
desc: 'when in aup mode, update all packages instead of only the local one'
|
73
|
+
option :keep_going, aliases: :k, type: :boolean,
|
74
|
+
banner: '',
|
75
|
+
desc: 'do not stop on build or checkout errors'
|
76
|
+
option :config, type: :boolean,
|
77
|
+
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"
|
78
|
+
option :autoproj, type: :boolean,
|
79
|
+
desc: "(do not) update autoproj. This is automatically enabled only if no arguments are given on the command line"
|
80
|
+
option :osdeps, type: :boolean,
|
81
|
+
default: true,
|
82
|
+
desc: "enable or disable osdeps handling"
|
83
|
+
option :from, type: :string,
|
84
|
+
desc: 'use this existing autoproj installation to check out the packages (for importers that support this)'
|
85
|
+
option :checkout_only, aliases: :c, type: :boolean, default: false,
|
86
|
+
desc: "only checkout packages, do not update existing ones"
|
87
|
+
option :local, type: :boolean, default: false,
|
88
|
+
desc: "use only local information for the update (for importers that support it)"
|
89
|
+
option :osdeps_filter_uptodate, default: true, type: :boolean,
|
90
|
+
desc: 'controls whether the osdeps subsystem should filter up-to-date packages or not', default: true
|
91
|
+
option :deps, default: true, type: :boolean,
|
92
|
+
desc: 'whether the package dependencies should be recursively updated (the default) or not'
|
93
|
+
def update(*packages)
|
94
|
+
run_autoproj_cli(:update, :Update, Hash[silent: false], *packages)
|
95
|
+
end
|
96
|
+
|
97
|
+
desc 'build', 'build packages'
|
98
|
+
option :amake, default: false, hide: true, type: :boolean,
|
99
|
+
desc: 'behave like amake'
|
100
|
+
option :all, default: false, hide: true, type: :boolean,
|
101
|
+
desc: 'when in amake mode, build all packages instead of only the local one'
|
102
|
+
option :keep_going, aliases: :k, type: :boolean, default: false,
|
103
|
+
desc: 'do not stop on build or checkout errors'
|
104
|
+
option :force, type: :boolean, default: false,
|
105
|
+
desc: 'force reconfiguration-build cycle on the requested packages, even if they do not seem to need it'
|
106
|
+
option :rebuild, type: :boolean, default: false,
|
107
|
+
desc: 'clean and build the requested packages'
|
108
|
+
option :osdeps, type: :boolean,
|
109
|
+
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)'
|
110
|
+
option :deps, type: :boolean,
|
111
|
+
desc: 'in force or rebuild modes, control whether the force/rebuild action should apply only on the packages given on the command line, or on their dependencies as well (the default is --no-deps)'
|
112
|
+
def build(*packages)
|
113
|
+
run_autoproj_cli(:build, :Build, Hash[silent: false], *packages)
|
114
|
+
end
|
115
|
+
|
116
|
+
desc 'cache CACHE_DIR', 'create or update a cache directory that can be given to AUTOBUILD_CACHE_DIR'
|
117
|
+
option :keep_going, aliases: :k,
|
118
|
+
desc: 'do not stop on errors'
|
119
|
+
def cache(cache_dir)
|
120
|
+
run_autoproj_cli(:cache, :Cache, Hash[], cache_dir)
|
121
|
+
end
|
122
|
+
|
123
|
+
desc 'clean [PACKAGES]', 'remove build byproducts for the given packages'
|
124
|
+
option :all,
|
125
|
+
desc: 'bypass the safety question when you mean to clean all packages'
|
126
|
+
def clean(*packages)
|
127
|
+
run_autoproj_cli(:clean, :Clean, Hash[], *packages)
|
128
|
+
end
|
129
|
+
|
130
|
+
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'
|
131
|
+
def locate(package = nil)
|
132
|
+
run_autoproj_cli(:locate, :Locate, Hash[], *Array(package))
|
133
|
+
end
|
134
|
+
|
135
|
+
desc 'reconfigure', 'pass through all configuration questions'
|
136
|
+
option :separate_prefixes, type: :boolean,
|
137
|
+
desc: "sets or clears autoproj's separate prefixes mode"
|
138
|
+
def reconfigure
|
139
|
+
run_autoproj_cli(:reconfigure, :Reconfigure, Hash[])
|
140
|
+
end
|
141
|
+
|
142
|
+
desc 'test', 'interface for running tests'
|
143
|
+
subcommand 'test', MainTest
|
144
|
+
|
145
|
+
desc 'show', 'show informations about package(s)'
|
146
|
+
option :mainline, type: :string,
|
147
|
+
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"
|
148
|
+
def show(*packages)
|
149
|
+
run_autoproj_cli(:show, :Show, Hash[], *packages)
|
150
|
+
end
|
151
|
+
|
152
|
+
desc 'osdeps [PACKAGES]', 'install/update OS dependencies that are required by the given package (or for the whole installation if no packages are given'
|
153
|
+
option :update, type: :boolean, default: true,
|
154
|
+
desc: 'whether already installed packages should be updated or not'
|
155
|
+
def osdeps(*packages)
|
156
|
+
run_autoproj_cli(:osdeps, :OSDeps, Hash[], *packages)
|
157
|
+
end
|
158
|
+
|
159
|
+
desc 'versions [PACKAGES]', 'generate a version file for the given packages, or all packages if none are given'
|
160
|
+
option :package_sets, type: :boolean,
|
161
|
+
default: nil,
|
162
|
+
banner: '',
|
163
|
+
desc: 'controls whether the package sets should be versioned as well. This is the default if no packages are given on the command line or if the autoproj directory is'
|
164
|
+
option :keep_going, aliases: :k, type: :boolean,
|
165
|
+
default: false,
|
166
|
+
banner: '',
|
167
|
+
desc: 'do not stop if some package cannot be versioned'
|
168
|
+
option :replace, type: :boolean,
|
169
|
+
default: false,
|
170
|
+
desc: 'in combination with --save, controls whether an existing file should be updated or replaced'
|
171
|
+
option :save, type: :string,
|
172
|
+
desc: 'save to the given file instead of displaying it on the standard output'
|
173
|
+
def versions(*packages)
|
174
|
+
run_autoproj_cli(:versions, :Versions, Hash[], *packages)
|
175
|
+
end
|
176
|
+
|
177
|
+
stop_on_unknown_option! :log
|
178
|
+
desc 'log', "shows the log of autoproj updates"
|
179
|
+
def log(*args)
|
180
|
+
run_autoproj_cli(:log, :Log, Hash[], *args)
|
181
|
+
end
|
182
|
+
|
183
|
+
desc 'reset VERSION_ID', 'resets packages to the required version (either reflog from autoproj log or commit/tag in the build configuration'
|
184
|
+
option :freeze, type: :boolean, default: false,
|
185
|
+
desc: 'whether the version we reset to should be saved in overrides.d or not'
|
186
|
+
def reset(version_id)
|
187
|
+
run_autoproj_cli(:reset, :Reset, Hash[], version_id)
|
188
|
+
end
|
189
|
+
|
190
|
+
desc 'tag [TAG_NAME] [PACKAGES]', 'save the package current versions as a tag in the main build configuration, or lists the available tags if given no arguments'
|
191
|
+
option :package_sets, type: :boolean,
|
192
|
+
desc: 'commit the package set state as well (enabled by default)'
|
193
|
+
option :keep_going, aliases: :k, type: :boolean,
|
194
|
+
banner: '',
|
195
|
+
desc: 'do not stop on build or checkout errors'
|
196
|
+
option :message, aliases: :m, type: :string,
|
197
|
+
desc: 'the message to use for the new commit (the default is to mention the creation of the tag)'
|
198
|
+
def tag(tag_name = nil, *packages)
|
199
|
+
run_autoproj_cli(:tag, :Tag, Hash[], tag_name, *packages)
|
200
|
+
end
|
201
|
+
|
202
|
+
desc 'tag [PACKAGES]', 'save the package current versions as a new commit in the main build configuration'
|
203
|
+
option :package_sets, type: :boolean,
|
204
|
+
desc: 'commit the package set state as well (enabled by default)'
|
205
|
+
option :keep_going, aliases: :k, type: :boolean,
|
206
|
+
banner: '',
|
207
|
+
desc: 'do not stop on build or checkout errors'
|
208
|
+
option :message, aliases: :m, type: :string,
|
209
|
+
desc: 'the message to use for the new commit (the default is to mention the creation of the tag)'
|
210
|
+
def tag(*packages)
|
211
|
+
run_autoproj_cli(:tag, :Tag, Hash[], *packages)
|
212
|
+
end
|
213
|
+
|
214
|
+
desc 'switch-config VCS URL [OPTIONS]', 'switches the main build configuration'
|
215
|
+
def switch_config(*args)
|
216
|
+
run_autoproj_cli(:switch_config, :SwitchConfig, Hash[], *args)
|
217
|
+
end
|
218
|
+
|
219
|
+
desc 'query <query string>', 'searches for packages matching a query string'
|
220
|
+
long_desc <<-EOD
|
221
|
+
Finds packages that match query_string and displays information about them (one per line)
|
222
|
+
By default, only the package name is displayed. It can be customized with the --format option
|
223
|
+
|
224
|
+
QUERY KEYS
|
225
|
+
autobuild.name: the package name
|
226
|
+
autobuild.srcdir: the package source directory
|
227
|
+
autobuild.class.name: the package class
|
228
|
+
vcs.type: the VCS type (as used in the source.yml files)
|
229
|
+
vcs.url: the URL from the VCS. The exact semantic of it depends on the VCS type
|
230
|
+
package_set.name: the name of the package set that defines the package
|
231
|
+
|
232
|
+
FORMAT SPECIFICATION
|
233
|
+
|
234
|
+
The format is a string in which special values can be expanded using a $VARNAME format. The following variables are accepted:
|
235
|
+
NAME: the package name
|
236
|
+
SRCDIR: the full path to the package source directory
|
237
|
+
PREFIX: the full path to the package installation directory
|
238
|
+
EOD
|
239
|
+
option :search_all, type: :boolean,
|
240
|
+
desc: 'search in all defined packages instead of only in those selected selected in the layout'
|
241
|
+
option :format, type: :string,
|
242
|
+
desc: "customize what should be displayed. See FORMAT SPECIFICATION above"
|
243
|
+
def query(query_string)
|
244
|
+
run_autoproj_cli(:query, :Query, Hash[], query_string)
|
245
|
+
end
|
246
|
+
end
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|