autoproj 2.13.0 → 2.15.2
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 +5 -7
- data/bin/amake +4 -4
- data/bin/aup +4 -4
- data/bin/autoproj +3 -3
- data/bin/autoproj_bootstrap +224 -199
- data/bin/autoproj_bootstrap.in +7 -8
- data/bin/autoproj_install +223 -198
- 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 +64 -34
- 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 +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 -85
- data/lib/autoproj/default.osdeps +18 -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 +137 -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 +525 -507
- data/lib/autoproj/ops/import.rb +76 -64
- data/lib/autoproj/ops/install.rb +217 -191
- 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 +144 -113
- 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 +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 +142 -108
- data/lib/autoproj/zsh_completion.rb +8 -9
- data/lib/autoproj.rb +55 -55
- data/samples/autoproj/init.rb +1 -2
- metadata +80 -46
- data/.travis.yml +0 -24
@@ -1,15 +1,16 @@
|
|
1
1
|
module Autoproj
|
2
2
|
module CLI
|
3
3
|
class MainDoc < Thor
|
4
|
-
namespace
|
4
|
+
namespace "doc"
|
5
5
|
|
6
|
-
default_command
|
6
|
+
default_command "exec"
|
7
7
|
|
8
8
|
no_commands do
|
9
9
|
def report(report_options = Hash.new)
|
10
10
|
options = self.options.merge(parent_options)
|
11
11
|
extra_options = Hash.new
|
12
|
-
if
|
12
|
+
if options[:tool]
|
13
|
+
Autobuild::Subprocess.transparent_mode = true
|
13
14
|
Autobuild.silent = true
|
14
15
|
Autobuild.color = false
|
15
16
|
report_options[:silent] = true
|
@@ -22,11 +23,11 @@ module Autoproj
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
desc
|
26
|
+
desc "enable [PACKAGES]", "enable docs for the given packages (or for all packages if none are given)"
|
26
27
|
option :deps, type: :boolean, default: false,
|
27
|
-
|
28
|
+
desc: "controls whether the dependencies of the packages given on the command line should be enabled as well (the default is not)"
|
28
29
|
def enable(*packages)
|
29
|
-
require
|
30
|
+
require "autoproj/cli/doc"
|
30
31
|
report(silent: true) do
|
31
32
|
cli = Doc.new
|
32
33
|
args = cli.validate_options(packages, options)
|
@@ -34,11 +35,11 @@ module Autoproj
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
37
|
-
desc
|
38
|
+
desc "disable [PACKAGES]", "disable docs for the given packages (or for all packages if none are given)"
|
38
39
|
option :deps, type: :boolean, default: false,
|
39
|
-
|
40
|
+
desc: "controls whether the dependencies of the packages given on the command line should be disabled as well (the default is not)"
|
40
41
|
def disable(*packages)
|
41
|
-
require
|
42
|
+
require "autoproj/cli/doc"
|
42
43
|
report(silent: true) do
|
43
44
|
cli = Doc.new
|
44
45
|
args = cli.validate_options(packages, options)
|
@@ -46,11 +47,11 @@ module Autoproj
|
|
46
47
|
end
|
47
48
|
end
|
48
49
|
|
49
|
-
desc
|
50
|
+
desc "list [PACKAGES]", "show doc enable/disable status for the given packages (or all packages if none are given)"
|
50
51
|
option :deps, type: :boolean, default: true,
|
51
|
-
|
52
|
+
desc: "controls whether the dependencies of the packages given on the command line should be disabled as well (the default is not)"
|
52
53
|
def list(*packages)
|
53
|
-
require
|
54
|
+
require "autoproj/cli/doc"
|
54
55
|
report(silent: true) do
|
55
56
|
cli = Doc.new
|
56
57
|
args = cli.validate_options(packages, options)
|
@@ -58,21 +59,21 @@ module Autoproj
|
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
61
|
-
desc
|
62
|
+
desc "exec [PACKAGES]", "generate documentation for the given packages, or all if no packages are given on the command line"
|
62
63
|
option :deps, type: :boolean, default: false,
|
63
|
-
|
64
|
-
option :no_deps_shortcut, hide: true, aliases:
|
65
|
-
|
64
|
+
desc: "controls whether to generate documentation of the dependencies of the packages given on the command line (the default is not)"
|
65
|
+
option :no_deps_shortcut, hide: true, aliases: "-n", type: :boolean,
|
66
|
+
desc: "provide -n for --no-deps"
|
66
67
|
option :parallel, aliases: :p, type: :numeric,
|
67
|
-
|
68
|
+
desc: "maximum number of parallel jobs"
|
68
69
|
option :tool, type: :boolean, default: false,
|
69
|
-
|
70
|
+
desc: "run in tool mode, which do not redirect the subcommand's outputs"
|
70
71
|
option :color, type: :boolean, default: TTY::Color.color?,
|
71
|
-
|
72
|
+
desc: "enables or disables colored display (enabled by default if the terminal supports it)"
|
72
73
|
option :progress, type: :boolean, default: TTY::Color.color?,
|
73
|
-
|
74
|
+
desc: "enables or disables progress display (enabled by default if the terminal supports it)"
|
74
75
|
def exec(*packages)
|
75
|
-
require
|
76
|
+
require "autoproj/cli/doc"
|
76
77
|
options = self.options.merge(parent_options)
|
77
78
|
report do |extra_options|
|
78
79
|
cli = Doc.new
|
@@ -1,38 +1,63 @@
|
|
1
1
|
module Autoproj
|
2
2
|
module CLI
|
3
3
|
class MainGlobal < Thor
|
4
|
-
namespace
|
4
|
+
namespace "global"
|
5
5
|
|
6
|
-
|
6
|
+
WorkspaceDir = Struct.new :name, :path, :present
|
7
|
+
|
8
|
+
no_commands do
|
9
|
+
def gather_workspaces_dirs(ws)
|
10
|
+
ws.each_with_object({}) do |w, h|
|
11
|
+
w_dirs = %w[root_dir prefix_dir build_dir].map do |name|
|
12
|
+
dir = w.public_send(name)
|
13
|
+
if dir.start_with?("/")
|
14
|
+
WorkspaceDir.new(name, dir, File.directory?(dir))
|
15
|
+
end
|
16
|
+
end.compact
|
17
|
+
|
18
|
+
h[w] = w_dirs
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def filter_removed_workspaces(dirs)
|
23
|
+
dirs.delete_if { |w, w_dirs| w_dirs.none?(&:present) }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
desc "register", "register the current workspace"
|
7
28
|
def register
|
8
|
-
require
|
29
|
+
require "autoproj"
|
9
30
|
ws = Workspace.default
|
10
31
|
ws.load_config
|
11
32
|
ws.register_workspace
|
12
33
|
end
|
13
34
|
|
14
|
-
desc
|
35
|
+
desc "status", "display information about the known workspaces"
|
15
36
|
def status
|
16
|
-
require
|
37
|
+
require "autoproj"
|
17
38
|
ws = Workspace.registered_workspaces
|
18
39
|
fields = Workspace::RegisteredWorkspace.members.map(&:to_s)
|
40
|
+
|
41
|
+
dirs = gather_workspaces_dirs(ws)
|
42
|
+
filter_removed_workspaces(dirs)
|
43
|
+
Workspace.save_registered_workspaces(dirs.keys)
|
44
|
+
|
19
45
|
format_w = fields.map(&:length).max + 1
|
20
46
|
format = "%-#{format_w}s %s (%s)"
|
21
|
-
blocks =
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end.compact.join("\n")
|
47
|
+
blocks = dirs.map do |w, w_dirs|
|
48
|
+
lines = w_dirs.map do |d|
|
49
|
+
status =
|
50
|
+
if d.present
|
51
|
+
Autobuild.color("present", :green)
|
52
|
+
else
|
53
|
+
Autobuild.color("absent", :yellow)
|
54
|
+
end
|
55
|
+
|
56
|
+
format(format, "#{d.name}:", d.path, status)
|
57
|
+
end
|
58
|
+
lines.join("\n")
|
34
59
|
end
|
35
|
-
puts blocks.join("---\n")
|
60
|
+
puts blocks.join("\n---\n")
|
36
61
|
end
|
37
62
|
end
|
38
63
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Autoproj
|
2
2
|
module CLI
|
3
3
|
class MainPlugin < Thor
|
4
|
-
namespace
|
4
|
+
namespace "plugin"
|
5
5
|
|
6
6
|
no_commands do
|
7
7
|
def ws
|
@@ -15,27 +15,27 @@ module Autoproj
|
|
15
15
|
|
16
16
|
def read_plugin_list
|
17
17
|
ws.load_config
|
18
|
-
ws.config.get(
|
18
|
+
ws.config.get("plugins", Hash.new)
|
19
19
|
end
|
20
20
|
|
21
21
|
def write_plugin_list(plugins)
|
22
22
|
ws.load_config
|
23
|
-
ws.config.set(
|
23
|
+
ws.config.set("plugins", plugins)
|
24
24
|
ws.save_config
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
|
-
desc
|
29
|
-
option :version, desc:
|
30
|
-
|
31
|
-
option :git, desc:
|
32
|
-
|
33
|
-
option :branch, desc:
|
34
|
-
|
35
|
-
option :path, desc:
|
36
|
-
|
28
|
+
desc "install NAME", "install or upgrade an autoproj plugin"
|
29
|
+
option :version, desc: "a gem version constraint",
|
30
|
+
type: "string", default: ">= 0"
|
31
|
+
option :git, desc: "checkout a git repository instead of downloading the gem",
|
32
|
+
type: "string"
|
33
|
+
option :branch, desc: "choose the branch that should be checked out with --git",
|
34
|
+
type: "string", default: "master"
|
35
|
+
option :path, desc: "use the plugin that is already present on this path",
|
36
|
+
type: "string"
|
37
37
|
def install(name)
|
38
|
-
require
|
38
|
+
require "autoproj"
|
39
39
|
|
40
40
|
gem_options = Hash.new
|
41
41
|
if options[:git] && options[:path]
|
@@ -59,18 +59,18 @@ module Autoproj
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
desc
|
62
|
+
desc "list", "list installed plugins"
|
63
63
|
def list
|
64
|
-
require
|
64
|
+
require "autoproj"
|
65
65
|
read_plugin_list.sort_by(&:first).each do |name, (version, options)|
|
66
66
|
args = [version, *options.map { |k, v| "#{k}: \"#{v}\"" }]
|
67
|
-
puts "#{name}: #{args.join(
|
67
|
+
puts "#{name}: #{args.join(', ')}"
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
desc
|
71
|
+
desc "remove NAME", "uninstall a plugin"
|
72
72
|
def remove(name)
|
73
|
-
require
|
73
|
+
require "autoproj"
|
74
74
|
plugins = read_plugin_list
|
75
75
|
updated_plugins = plugins.dup
|
76
76
|
updated_plugins.delete(name)
|
@@ -1,15 +1,16 @@
|
|
1
1
|
module Autoproj
|
2
2
|
module CLI
|
3
3
|
class MainTest < Thor
|
4
|
-
namespace
|
4
|
+
namespace "test"
|
5
5
|
|
6
|
-
default_command
|
6
|
+
default_command "exec"
|
7
7
|
|
8
8
|
no_commands do
|
9
9
|
def report(report_options = Hash.new)
|
10
10
|
options = self.options.merge(parent_options)
|
11
11
|
extra_options = Hash.new
|
12
|
-
if
|
12
|
+
if options[:tool]
|
13
|
+
Autobuild::Subprocess.transparent_mode = true
|
13
14
|
Autobuild.silent = true
|
14
15
|
Autobuild.color = false
|
15
16
|
report_options[:silent] = true
|
@@ -22,26 +23,26 @@ module Autoproj
|
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
25
|
-
desc
|
26
|
+
desc "default [on|off]", "set whether tests are enabled or disabled by default, without touching existing settings"
|
26
27
|
def default(on_or_off)
|
27
|
-
require
|
28
|
+
require "autoproj/cli/test"
|
28
29
|
report(silent: true) do
|
29
30
|
cli = Test.new
|
30
31
|
args = cli.validate_options([], options)
|
31
32
|
enabled = case on_or_off
|
32
|
-
when
|
33
|
-
when
|
33
|
+
when "on" then true
|
34
|
+
when "off" then false
|
34
35
|
else raise ArgumentError, "expected 'on' or 'off'"
|
35
36
|
end
|
36
37
|
cli.default(enabled)
|
37
38
|
end
|
38
39
|
end
|
39
40
|
|
40
|
-
desc
|
41
|
+
desc "enable [PACKAGES]", "enable tests for the given packages (or for all packages if none are given)"
|
41
42
|
option :deps, type: :boolean, default: false,
|
42
|
-
|
43
|
+
desc: "controls whether the dependencies of the packages given on the command line should be enabled as well (the default is not)"
|
43
44
|
def enable(*packages)
|
44
|
-
require
|
45
|
+
require "autoproj/cli/test"
|
45
46
|
report(silent: true) do
|
46
47
|
cli = Test.new
|
47
48
|
args = cli.validate_options(packages, options)
|
@@ -49,11 +50,11 @@ module Autoproj
|
|
49
50
|
end
|
50
51
|
end
|
51
52
|
|
52
|
-
desc
|
53
|
+
desc "disable [PACKAGES]", "disable tests for the given packages (or for all packages if none are given)"
|
53
54
|
option :deps, type: :boolean, default: false,
|
54
|
-
|
55
|
+
desc: "controls whether the dependencies of the packages given on the command line should be disabled as well (the default is not)"
|
55
56
|
def disable(*packages)
|
56
|
-
require
|
57
|
+
require "autoproj/cli/test"
|
57
58
|
report(silent: true) do
|
58
59
|
cli = Test.new
|
59
60
|
args = cli.validate_options(packages, options)
|
@@ -61,11 +62,11 @@ module Autoproj
|
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
64
|
-
desc
|
65
|
+
desc "list [PACKAGES]", "show test enable/disable status for the given packages (or all packages if none are given)"
|
65
66
|
option :deps, type: :boolean, default: true,
|
66
|
-
|
67
|
+
desc: "controls whether the dependencies of the packages given on the command line should be disabled as well (the default is not)"
|
67
68
|
def list(*packages)
|
68
|
-
require
|
69
|
+
require "autoproj/cli/test"
|
69
70
|
report(silent: true) do
|
70
71
|
cli = Test.new
|
71
72
|
args = cli.validate_options(packages, options)
|
@@ -73,26 +74,26 @@ module Autoproj
|
|
73
74
|
end
|
74
75
|
end
|
75
76
|
|
76
|
-
desc
|
77
|
+
desc "exec [PACKAGES]", "execute the tests for the given packages, or all if no packages are given on the command line"
|
77
78
|
option :keep_going, aliases: :k, type: :boolean,
|
78
|
-
|
79
|
-
|
79
|
+
banner: "",
|
80
|
+
desc: "do not stop on build or checkout errors"
|
80
81
|
option :deps, type: :boolean, default: false,
|
81
|
-
|
82
|
+
desc: "controls whether to execute the tests of the dependencies of the packages given on the command line (the default is not)"
|
82
83
|
option :parallel, aliases: :p, type: :numeric,
|
83
|
-
|
84
|
+
desc: "maximum number of parallel jobs"
|
84
85
|
option :fail, type: :boolean, default: true,
|
85
|
-
|
86
|
+
desc: "return with a nonzero exit code if the test does not pass"
|
86
87
|
option :coverage, type: :boolean, default: false,
|
87
|
-
|
88
|
+
desc: "whether code coverage should be generated if possible"
|
88
89
|
option :tool, type: :boolean, default: false,
|
89
|
-
|
90
|
+
desc: "build in tool mode, which do not redirect the subcommand's outputs"
|
90
91
|
option :color, type: :boolean, default: TTY::Color.color?,
|
91
|
-
|
92
|
+
desc: "enables or disables colored display (enabled by default if the terminal supports it)"
|
92
93
|
option :progress, type: :boolean, default: TTY::Color.color?,
|
93
|
-
|
94
|
+
desc: "enables or disables progress display (enabled by default if the terminal supports it)"
|
94
95
|
def exec(*packages)
|
95
|
-
require
|
96
|
+
require "autoproj/cli/test"
|
96
97
|
options = self.options.merge(parent_options)
|
97
98
|
report do |extra_options|
|
98
99
|
cli = Test.new
|
@@ -1,10 +1,10 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "autoproj"
|
2
|
+
require "autoproj/cli/base"
|
3
3
|
module Autoproj
|
4
4
|
module CLI
|
5
5
|
class Manifest < Base
|
6
6
|
def validate_options(args, options)
|
7
|
-
|
7
|
+
[args, options]
|
8
8
|
end
|
9
9
|
|
10
10
|
def run(name, options = Hash.new)
|
@@ -21,11 +21,12 @@ module Autoproj
|
|
21
21
|
full_path = File.join(ws.config_dir, name)
|
22
22
|
end
|
23
23
|
|
24
|
-
|
24
|
+
unless File.file?(full_path)
|
25
25
|
alternative_full_path = File.join(ws.config_dir, "manifest.#{name}")
|
26
|
-
|
26
|
+
unless File.file?(alternative_full_path)
|
27
27
|
raise CLIInvalidArguments, "neither #{full_path} nor #{alternative_full_path} exist"
|
28
28
|
end
|
29
|
+
|
29
30
|
full_path = alternative_full_path
|
30
31
|
end
|
31
32
|
begin
|
@@ -34,7 +35,7 @@ module Autoproj
|
|
34
35
|
Autoproj.error "failed to load #{full_path}"
|
35
36
|
raise
|
36
37
|
end
|
37
|
-
ws.config.set
|
38
|
+
ws.config.set "manifest_name", File.basename(full_path)
|
38
39
|
ws.save_config
|
39
40
|
Autoproj.message "set manifest to #{full_path}"
|
40
41
|
else
|
@@ -47,4 +48,3 @@ module Autoproj
|
|
47
48
|
end
|
48
49
|
end
|
49
50
|
end
|
50
|
-
|
data/lib/autoproj/cli/osdeps.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "autoproj/cli/inspection_tool"
|
2
2
|
|
3
3
|
module Autoproj
|
4
4
|
module CLI
|
@@ -8,18 +8,18 @@ module Autoproj
|
|
8
8
|
if options[:system_info]
|
9
9
|
os_names, os_versions = ws.os_package_resolver.operating_system
|
10
10
|
os_package_manager_names = OSPackageResolver::OS_PACKAGE_MANAGERS.values
|
11
|
-
os_indep_managers = ws.os_package_installer.package_managers
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
puts "OS Names: #{(os_names - ['default']).join(
|
16
|
-
puts "OS Versions: #{(os_versions - ['default']).join(
|
11
|
+
os_indep_managers = ws.os_package_installer.package_managers
|
12
|
+
.each_key.find_all do |name, manager|
|
13
|
+
!os_package_manager_names.include?(name)
|
14
|
+
end
|
15
|
+
puts "OS Names: #{(os_names - ['default']).join(', ')}"
|
16
|
+
puts "OS Versions: #{(os_versions - ['default']).join(', ')}"
|
17
17
|
puts "OS Package Manager: #{ws.os_package_resolver.os_package_manager}"
|
18
|
-
puts "Available Package Managers: #{os_indep_managers.sort.join(
|
18
|
+
puts "Available Package Managers: #{os_indep_managers.sort.join(', ')}"
|
19
19
|
return
|
20
20
|
end
|
21
21
|
|
22
|
-
_, osdep_packages, resolved_selection,
|
22
|
+
_, osdep_packages, resolved_selection, =
|
23
23
|
finalize_setup(user_selection)
|
24
24
|
|
25
25
|
shell_helpers = options.fetch(:shell_helpers, ws.config.shell_helpers?)
|
@@ -28,10 +28,11 @@ module Autoproj
|
|
28
28
|
ws.install_os_packages(
|
29
29
|
osdep_packages,
|
30
30
|
run_package_managers_without_packages: true,
|
31
|
-
install_only: !update
|
31
|
+
install_only: !update
|
32
|
+
)
|
32
33
|
export_env_sh(shell_helpers: shell_helpers)
|
33
34
|
Main.run_post_command_hook(:update, ws, source_packages: [],
|
34
|
-
|
35
|
+
osdep_packages: osdep_packages)
|
35
36
|
end
|
36
37
|
end
|
37
38
|
end
|
data/lib/autoproj/cli/patcher.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require
|
1
|
+
require "autoproj/cli/inspection_tool"
|
2
2
|
module Autoproj
|
3
3
|
module CLI
|
4
4
|
# Interface to patch/unpatch a package
|
5
5
|
class Patcher < InspectionTool
|
6
6
|
def run(packages, patch: true)
|
7
7
|
initialize_and_load
|
8
|
-
packages,
|
8
|
+
packages, = finalize_setup(packages, recursive: false, non_imported_packages: :ignore)
|
9
9
|
packages.each do |package_name|
|
10
10
|
pkg = ws.manifest.package_definition_by_name(package_name)
|
11
11
|
if patch
|
@@ -18,4 +18,3 @@ module Autoproj
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
21
|
-
|
data/lib/autoproj/cli/query.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "autoproj"
|
2
|
+
require "autoproj/cli/inspection_tool"
|
3
3
|
|
4
4
|
module Autoproj
|
5
5
|
module CLI
|
@@ -10,14 +10,14 @@ module Autoproj
|
|
10
10
|
|
11
11
|
def find_all_matches(query, packages)
|
12
12
|
matches = packages.map do |pkg|
|
13
|
-
if priority = query.match(pkg)
|
13
|
+
if (priority = query.match(pkg))
|
14
14
|
[priority, pkg]
|
15
15
|
end
|
16
16
|
end.compact
|
17
17
|
matches.sort_by { |priority, pkg| [priority, pkg.name] }
|
18
18
|
end
|
19
19
|
|
20
|
-
def run(query_string, format:
|
20
|
+
def run(query_string, format: "$NAME", search_all: false, only_present: false, osdeps: false)
|
21
21
|
initialize_and_load
|
22
22
|
all_selected_packages, all_selected_osdeps_packages, * =
|
23
23
|
finalize_setup([], non_imported_packages: :return)
|
@@ -29,7 +29,7 @@ module Autoproj
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
def query_os_packages(query_string, selected_packages, format:
|
32
|
+
def query_os_packages(query_string, selected_packages, format: "$NAME", search_all: false)
|
33
33
|
if query_string.empty?
|
34
34
|
query = OSPackageQuery.all
|
35
35
|
else
|
@@ -67,14 +67,14 @@ module Autoproj
|
|
67
67
|
|
68
68
|
def format_osdep_package(format, priority, name, handler, real_package_name)
|
69
69
|
fields = Hash.new
|
70
|
-
fields[
|
71
|
-
fields[
|
72
|
-
fields[
|
73
|
-
fields[
|
70
|
+
fields["NAME"] = name
|
71
|
+
fields["PRIORITY"] = priority
|
72
|
+
fields["HANDLER"] = handler
|
73
|
+
fields["REAL_PACKAGE"] = real_package_name
|
74
74
|
Autoproj.expand(format, fields)
|
75
75
|
end
|
76
76
|
|
77
|
-
def query_source_packages(query_string, selected_packages, format:
|
77
|
+
def query_source_packages(query_string, selected_packages, format: "$NAME", search_all: false, only_present: false)
|
78
78
|
if query_string.empty?
|
79
79
|
query = SourcePackageQuery.all
|
80
80
|
else
|
@@ -105,18 +105,17 @@ module Autoproj
|
|
105
105
|
def format_source_package(format, priority, package)
|
106
106
|
autobuild_package = package.autobuild
|
107
107
|
fields = Hash.new
|
108
|
-
fields[
|
109
|
-
fields[
|
108
|
+
fields["SRCDIR"] = autobuild_package.srcdir
|
109
|
+
fields["BUILDDIR"] = if autobuild_package.respond_to?(:builddir)
|
110
110
|
autobuild_package.builddir
|
111
111
|
end
|
112
|
-
fields[
|
113
|
-
fields[
|
114
|
-
fields[
|
115
|
-
fields[
|
116
|
-
fields[
|
112
|
+
fields["PREFIX"] = autobuild_package.prefix
|
113
|
+
fields["NAME"] = package.name
|
114
|
+
fields["PRIORITY"] = priority
|
115
|
+
fields["URL"] = (package.vcs.url unless package.vcs.none?)
|
116
|
+
fields["PRESENT"] = File.directory?(autobuild_package.srcdir)
|
117
117
|
Autoproj.expand(format, fields)
|
118
118
|
end
|
119
119
|
end
|
120
120
|
end
|
121
121
|
end
|
122
|
-
|
data/lib/autoproj/cli/reset.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
1
|
+
require "autoproj/cli"
|
2
|
+
require "autoproj/cli/inspection_tool"
|
3
|
+
require "autoproj/cli/update"
|
4
|
+
require "autoproj/cli/versions"
|
5
5
|
|
6
6
|
module Autoproj
|
7
7
|
module CLI
|
@@ -24,7 +24,8 @@ module Autoproj
|
|
24
24
|
# Checkout the version file
|
25
25
|
versions_file = File.join(
|
26
26
|
Workspace::OVERRIDES_DIR,
|
27
|
-
Versions::DEFAULT_VERSIONS_FILE_BASENAME
|
27
|
+
Versions::DEFAULT_VERSIONS_FILE_BASENAME
|
28
|
+
)
|
28
29
|
begin
|
29
30
|
file_data = importer.show(pkg, ref_name, versions_file)
|
30
31
|
versions_path = File.join(ws.config_dir, versions_file)
|
@@ -34,23 +35,19 @@ module Autoproj
|
|
34
35
|
FileUtils.cp versions_path, old_versions_path
|
35
36
|
end
|
36
37
|
FileUtils.mkdir_p File.join(ws.config_dir, Workspace::OVERRIDES_DIR)
|
37
|
-
File.open(versions_path,
|
38
|
+
File.open(versions_path, "w") do |io|
|
38
39
|
io.write file_data
|
39
40
|
end
|
40
41
|
|
41
42
|
update = CLI::Update.new
|
42
43
|
run_args = update.run([], reset: true)
|
43
|
-
|
44
44
|
ensure
|
45
|
-
|
45
|
+
unless options[:freeze]
|
46
46
|
FileUtils.rm_f versions_path
|
47
|
-
if old_versions_path
|
48
|
-
FileUtils.mv old_versions_path, versions_path
|
49
|
-
end
|
47
|
+
FileUtils.mv old_versions_path, versions_path if old_versions_path
|
50
48
|
end
|
51
49
|
end
|
52
50
|
end
|
53
51
|
end
|
54
52
|
end
|
55
53
|
end
|
56
|
-
|