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
@@ -1,6 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "autoproj/repository_managers/manager"
|
2
|
+
require "autoproj/repository_managers/unknown_os_manager"
|
3
|
+
require "autoproj/repository_managers/apt"
|
4
4
|
|
5
5
|
module Autoproj
|
6
6
|
class OSRepositoryInstaller
|
@@ -11,7 +11,7 @@ module Autoproj
|
|
11
11
|
attr_reader :repository_managers
|
12
12
|
|
13
13
|
OS_REPOSITORY_MANAGERS = {
|
14
|
-
|
14
|
+
"debian" => RepositoryManagers::APT
|
15
15
|
}.freeze
|
16
16
|
|
17
17
|
def initialize(ws)
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "tempfile"
|
2
|
+
require "json"
|
3
3
|
|
4
4
|
module Autoproj
|
5
5
|
# Manager for OS repository provided by package sets
|
@@ -11,7 +11,9 @@ module Autoproj
|
|
11
11
|
attr_accessor :operating_system
|
12
12
|
|
13
13
|
def self.load(file)
|
14
|
-
|
14
|
+
unless File.file?(file)
|
15
|
+
raise ArgumentError, "no such file or directory: #{file}"
|
16
|
+
end
|
15
17
|
|
16
18
|
error_t = if defined? Psych::SyntaxError
|
17
19
|
[ArgumentError, Psych::SyntaxError]
|
@@ -62,12 +64,12 @@ module Autoproj
|
|
62
64
|
end
|
63
65
|
|
64
66
|
def entry_matches?(entry, identifiers)
|
65
|
-
!(entry.keys.first.split(
|
67
|
+
!(entry.keys.first.split(",").map(&:strip) & identifiers).empty?
|
66
68
|
end
|
67
69
|
|
68
70
|
def resolved_entries
|
69
71
|
os_name, os_version = operating_system
|
70
|
-
os_version <<
|
72
|
+
os_version << "default" unless os_version.include?("default")
|
71
73
|
|
72
74
|
distribution_filtered = definitions.select do |entry|
|
73
75
|
entry_matches?(entry, os_name)
|
@@ -131,7 +133,7 @@ module Autoproj
|
|
131
133
|
return if obj.is_a?(type)
|
132
134
|
|
133
135
|
raise ArgumentError, "invalid osrepos definition in #{path.join('/')}: "\
|
134
|
-
|
136
|
+
"expected a #{type}, found a #{obj.class}"
|
135
137
|
end
|
136
138
|
end
|
137
139
|
end
|
@@ -15,6 +15,7 @@ module Autoproj
|
|
15
15
|
# @return [String] path to the file that contains this package's
|
16
16
|
# definition
|
17
17
|
attr_reader :file
|
18
|
+
|
18
19
|
# Whether this package is completely setup
|
19
20
|
#
|
20
21
|
# If the package is set up, its importer as well as all target
|
@@ -48,7 +49,7 @@ module Autoproj
|
|
48
49
|
# @return [Array<String>]
|
49
50
|
def modes
|
50
51
|
@modes + autobuild.utilities
|
51
|
-
|
52
|
+
.values.find_all(&:enabled?).map(&:name)
|
52
53
|
end
|
53
54
|
|
54
55
|
# The package name
|
@@ -83,19 +84,17 @@ module Autoproj
|
|
83
84
|
def apply_dependencies_from_manifest
|
84
85
|
manifest = autobuild.description
|
85
86
|
manifest.each_dependency(modes) do |name, is_optional|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
autobuild.depends_on name
|
91
|
-
end
|
92
|
-
rescue ConfigError => e
|
93
|
-
raise ConfigError.new(manifest.path),
|
94
|
-
"manifest #{manifest.path} of #{self.name} from "\
|
95
|
-
"#{package_set.name} lists '#{name}' as dependency, "\
|
96
|
-
'but it is neither a normal package nor an osdeps '\
|
97
|
-
"package. osdeps reports: #{e.message}", e.backtrace
|
87
|
+
if is_optional
|
88
|
+
autobuild.optional_dependency name
|
89
|
+
else
|
90
|
+
autobuild.depends_on name
|
98
91
|
end
|
92
|
+
rescue ConfigError => e
|
93
|
+
raise PackageNotFound.new(manifest.path),
|
94
|
+
"manifest #{manifest.path} of #{self.name} from "\
|
95
|
+
"#{package_set.name} lists '#{name}' as dependency, "\
|
96
|
+
"but it is neither a normal package nor an osdeps "\
|
97
|
+
"package. osdeps reports: #{e.message}", e.backtrace
|
99
98
|
end
|
100
99
|
end
|
101
100
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require "autoproj/package_managers/debian_version"
|
4
4
|
|
5
5
|
module Autoproj
|
6
6
|
module PackageManagers
|
@@ -9,6 +9,12 @@ module Autoproj
|
|
9
9
|
class AptDpkgManager < ShellScriptManager
|
10
10
|
attr_accessor :status_file
|
11
11
|
|
12
|
+
class << self
|
13
|
+
def inherit
|
14
|
+
@inherit ||= Set.new
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
12
18
|
def initialize(ws, status_file = "/var/lib/dpkg/status")
|
13
19
|
@status_file = status_file
|
14
20
|
@installed_packages = nil
|
@@ -21,19 +27,19 @@ module Autoproj
|
|
21
27
|
def configure_manager
|
22
28
|
super
|
23
29
|
ws.config.declare(
|
24
|
-
|
25
|
-
default:
|
26
|
-
doc: [
|
30
|
+
"apt_dpkg_update", "boolean",
|
31
|
+
default: "yes",
|
32
|
+
doc: ["Would you like autoproj to keep apt packages up-to-date?"]
|
27
33
|
)
|
28
34
|
keep_uptodate?
|
29
35
|
end
|
30
36
|
|
31
37
|
def keep_uptodate?
|
32
|
-
ws.config.get(
|
38
|
+
ws.config.get("apt_dpkg_update")
|
33
39
|
end
|
34
40
|
|
35
41
|
def keep_uptodate=(flag)
|
36
|
-
ws.config.set(
|
42
|
+
ws.config.set("apt_dpkg_update", flag, true)
|
37
43
|
end
|
38
44
|
|
39
45
|
def self.parse_package_status(
|
@@ -48,7 +54,7 @@ module Autoproj
|
|
48
54
|
end
|
49
55
|
end
|
50
56
|
if virtual && paragraph =~ /^Provides: (.*)$/
|
51
|
-
installed_packages.merge($1.split(
|
57
|
+
installed_packages.merge($1.split(",").map(&:strip))
|
52
58
|
end
|
53
59
|
end
|
54
60
|
end
|
@@ -76,7 +82,7 @@ module Autoproj
|
|
76
82
|
end
|
77
83
|
|
78
84
|
def self.parse_apt_cache_paragraph(paragraph)
|
79
|
-
version =
|
85
|
+
version = "0"
|
80
86
|
if (paragraph_m = /^Package: (.*)$/.match(paragraph))
|
81
87
|
package_name = paragraph_m[1]
|
82
88
|
version_m = /^Version: (.*)$/.match(paragraph)
|
@@ -87,7 +93,7 @@ module Autoproj
|
|
87
93
|
|
88
94
|
def self.parse_packages_versions(packages)
|
89
95
|
packages_versions = {}
|
90
|
-
apt_cache_show = `apt-cache show --no-all-versions #{packages.join(
|
96
|
+
apt_cache_show = `apt-cache show --no-all-versions #{packages.join(" ")}`
|
91
97
|
apt_cache_show = StringScanner.new(apt_cache_show)
|
92
98
|
return packages_versions unless apt_cache_show.scan(/Package: /)
|
93
99
|
|
@@ -115,7 +121,7 @@ module Autoproj
|
|
115
121
|
# On a dpkg-enabled system, checks if the provided package is installed
|
116
122
|
# and returns true if it is the case
|
117
123
|
def installed?(package_name, filter_uptodate_packages: false,
|
118
|
-
|
124
|
+
install_only: false)
|
119
125
|
unless @installed_packages && @installed_versions
|
120
126
|
@installed_packages, @installed_versions =
|
121
127
|
self.class.parse_dpkg_status(status_file)
|
@@ -129,6 +135,7 @@ module Autoproj
|
|
129
135
|
end
|
130
136
|
end
|
131
137
|
|
138
|
+
# rubocop:disable Metrics/AbcSize
|
132
139
|
def install(packages, filter_uptodate_packages: false, install_only: false)
|
133
140
|
if filter_uptodate_packages || install_only
|
134
141
|
already_installed, missing = packages.partition do |package_name|
|
@@ -144,12 +151,13 @@ module Autoproj
|
|
144
151
|
packages = missing + (need_update || [])
|
145
152
|
end
|
146
153
|
|
147
|
-
if super(packages)
|
154
|
+
if super(packages, inherit: self.class.inherit)
|
148
155
|
# Invalidate caching of installed packages, as we just
|
149
156
|
# installed new packages !
|
150
157
|
@installed_packages = nil
|
151
158
|
end
|
152
159
|
end
|
160
|
+
# rubocop:enable Metrics/AbcSize
|
153
161
|
end
|
154
162
|
end
|
155
163
|
end
|