autoproj 2.12.1 → 2.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +25 -0
- data/.github/workflows/test.yml +30 -0
- data/.rubocop.yml +79 -91
- data/.rubocop_todo.yml +1473 -0
- data/Gemfile +9 -9
- data/Rakefile +24 -24
- data/autoproj.gemspec +24 -22
- data/bin/alocate +4 -4
- data/bin/alog +6 -7
- data/bin/amake +4 -4
- data/bin/aup +4 -4
- data/bin/autoproj +3 -3
- data/bin/autoproj_bootstrap +225 -200
- data/bin/autoproj_bootstrap.in +7 -8
- data/bin/autoproj_install +224 -199
- data/bin/autoproj_install.in +6 -7
- data/lib/autoproj/aruba_minitest.rb +6 -11
- data/lib/autoproj/autobuild.rb +9 -6
- data/lib/autoproj/autobuild_extensions/archive_importer.rb +10 -11
- data/lib/autoproj/autobuild_extensions/dsl.rb +66 -36
- data/lib/autoproj/autobuild_extensions/git.rb +27 -26
- data/lib/autoproj/autobuild_extensions/package.rb +23 -22
- data/lib/autoproj/autobuild_extensions/python.rb +18 -0
- data/lib/autoproj/autobuild_extensions/svn.rb +1 -2
- data/lib/autoproj/base.rb +1 -1
- data/lib/autoproj/bash_completion.rb +5 -6
- data/lib/autoproj/build_option.rb +22 -24
- data/lib/autoproj/cli/base.rb +26 -26
- data/lib/autoproj/cli/bootstrap.rb +14 -16
- data/lib/autoproj/cli/build.rb +10 -7
- data/lib/autoproj/cli/cache.rb +11 -11
- data/lib/autoproj/cli/clean.rb +10 -10
- data/lib/autoproj/cli/commit.rb +7 -8
- data/lib/autoproj/cli/doc.rb +2 -2
- data/lib/autoproj/cli/envsh.rb +1 -2
- data/lib/autoproj/cli/exec.rb +60 -20
- data/lib/autoproj/cli/inspection_tool.rb +13 -7
- data/lib/autoproj/cli/locate.rb +30 -41
- data/lib/autoproj/cli/log.rb +7 -7
- data/lib/autoproj/cli/main.rb +217 -205
- data/lib/autoproj/cli/main_doc.rb +22 -21
- data/lib/autoproj/cli/main_global.rb +44 -19
- data/lib/autoproj/cli/main_plugin.rb +18 -18
- data/lib/autoproj/cli/main_test.rb +28 -27
- data/lib/autoproj/cli/manifest.rb +7 -7
- data/lib/autoproj/cli/osdeps.rb +12 -11
- data/lib/autoproj/cli/patcher.rb +2 -3
- data/lib/autoproj/cli/query.rb +17 -18
- data/lib/autoproj/cli/reconfigure.rb +1 -2
- data/lib/autoproj/cli/reset.rb +9 -12
- data/lib/autoproj/cli/show.rb +38 -39
- data/lib/autoproj/cli/status.rb +56 -44
- data/lib/autoproj/cli/switch_config.rb +5 -6
- data/lib/autoproj/cli/tag.rb +12 -11
- data/lib/autoproj/cli/test.rb +7 -7
- data/lib/autoproj/cli/update.rb +97 -43
- data/lib/autoproj/cli/utility.rb +14 -12
- data/lib/autoproj/cli/version.rb +42 -40
- data/lib/autoproj/cli/versions.rb +14 -15
- data/lib/autoproj/cli/watch.rb +33 -37
- data/lib/autoproj/cli/which.rb +16 -20
- data/lib/autoproj/cli.rb +4 -2
- data/lib/autoproj/configuration.rb +78 -86
- data/lib/autoproj/default.osdeps +29 -3
- data/lib/autoproj/environment.rb +42 -23
- data/lib/autoproj/exceptions.rb +9 -3
- data/lib/autoproj/find_workspace.rb +20 -25
- data/lib/autoproj/git_server_configuration.rb +40 -44
- data/lib/autoproj/gitorious.rb +1 -1
- data/lib/autoproj/installation_manifest.rb +64 -29
- data/lib/autoproj/local_package_set.rb +13 -11
- data/lib/autoproj/manifest.rb +139 -132
- data/lib/autoproj/metapackage.rb +2 -6
- data/lib/autoproj/ops/atomic_write.rb +7 -6
- data/lib/autoproj/ops/build.rb +4 -6
- data/lib/autoproj/ops/cache.rb +41 -43
- data/lib/autoproj/ops/cached_env.rb +5 -4
- data/lib/autoproj/ops/configuration.rb +519 -507
- data/lib/autoproj/ops/import.rb +88 -63
- data/lib/autoproj/ops/install.rb +218 -192
- data/lib/autoproj/ops/loader.rb +77 -76
- data/lib/autoproj/ops/main_config_switcher.rb +36 -45
- data/lib/autoproj/ops/phase_reporting.rb +4 -4
- data/lib/autoproj/ops/snapshot.rb +250 -247
- data/lib/autoproj/ops/tools.rb +76 -78
- data/lib/autoproj/ops/watch.rb +6 -6
- data/lib/autoproj/ops/which.rb +17 -14
- data/lib/autoproj/options.rb +13 -2
- data/lib/autoproj/os_package_installer.rb +102 -92
- data/lib/autoproj/os_package_query.rb +7 -13
- data/lib/autoproj/os_package_resolver.rb +189 -140
- data/lib/autoproj/os_repository_installer.rb +4 -4
- data/lib/autoproj/os_repository_resolver.rb +8 -6
- data/lib/autoproj/package_definition.rb +12 -13
- data/lib/autoproj/package_managers/apt_dpkg_manager.rb +19 -11
- data/lib/autoproj/package_managers/bundler_manager.rb +186 -129
- data/lib/autoproj/package_managers/debian_version.rb +25 -21
- data/lib/autoproj/package_managers/emerge_manager.rb +2 -3
- data/lib/autoproj/package_managers/gem_manager.rb +68 -77
- data/lib/autoproj/package_managers/homebrew_manager.rb +3 -4
- data/lib/autoproj/package_managers/manager.rb +8 -3
- data/lib/autoproj/package_managers/pacman_manager.rb +2 -3
- data/lib/autoproj/package_managers/pip_manager.rb +30 -28
- data/lib/autoproj/package_managers/pkg_manager.rb +3 -4
- data/lib/autoproj/package_managers/port_manager.rb +2 -3
- data/lib/autoproj/package_managers/shell_script_manager.rb +47 -25
- data/lib/autoproj/package_managers/unknown_os_manager.rb +5 -8
- data/lib/autoproj/package_managers/yum_manager.rb +12 -15
- data/lib/autoproj/package_managers/zypper_manager.rb +11 -14
- data/lib/autoproj/package_manifest.rb +28 -74
- data/lib/autoproj/package_selection.rb +187 -187
- data/lib/autoproj/package_set.rb +145 -114
- data/lib/autoproj/python.rb +297 -0
- data/lib/autoproj/query_base.rb +20 -14
- data/lib/autoproj/reporter.rb +19 -19
- data/lib/autoproj/repository_managers/apt.rb +102 -68
- data/lib/autoproj/repository_managers/unknown_os_manager.rb +3 -3
- data/lib/autoproj/ros_condition_parser.rb +84 -0
- data/lib/autoproj/ros_package_manifest.rb +125 -0
- data/lib/autoproj/shell_completion.rb +16 -13
- data/lib/autoproj/source_package_query.rb +29 -36
- data/lib/autoproj/system.rb +32 -21
- data/lib/autoproj/test.rb +131 -106
- data/lib/autoproj/variable_expansion.rb +10 -10
- data/lib/autoproj/vcs_definition.rb +53 -37
- data/lib/autoproj/version.rb +1 -1
- data/lib/autoproj/workspace.rb +143 -108
- data/lib/autoproj/zsh_completion.rb +8 -9
- data/lib/autoproj.rb +55 -53
- data/samples/autoproj/init.rb +1 -2
- metadata +86 -65
- data/.travis.yml +0 -22
data/lib/autoproj/cli/show.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
|
@@ -29,7 +29,7 @@ module Autoproj
|
|
29
29
|
end
|
30
30
|
|
31
31
|
if package_set_names.empty? && source_packages.empty? && all_matching_osdeps.empty?
|
32
|
-
Autoproj.error "no package set, packages or OS packages match #{user_selection.join(
|
32
|
+
Autoproj.error "no package set, packages or OS packages match #{user_selection.join(' ')}"
|
33
33
|
return
|
34
34
|
elsif !source_packages.empty? || !all_matching_osdeps.empty?
|
35
35
|
ws.load_all_available_package_manifests
|
@@ -48,7 +48,7 @@ module Autoproj
|
|
48
48
|
puts "pkg #{name}"
|
49
49
|
end
|
50
50
|
all_matching_osdeps.each do |name, sel|
|
51
|
-
puts "osdep #{name} (#{sel ?
|
51
|
+
puts "osdep #{name} (#{sel ? 'not selected' : 'selected'})"
|
52
52
|
end
|
53
53
|
else
|
54
54
|
package_set_names.each do |pkg_set_name|
|
@@ -66,17 +66,17 @@ module Autoproj
|
|
66
66
|
def display_package_set(name, package_per_line: 8)
|
67
67
|
puts Autoproj.color("package set #{name}", :bold)
|
68
68
|
pkg_set = ws.manifest.find_package_set(name)
|
69
|
-
|
69
|
+
unless File.directory?(pkg_set.raw_local_dir)
|
70
70
|
puts Autobuild.color(" this package set is not checked out", :magenta)
|
71
71
|
end
|
72
|
-
if overrides_key = pkg_set.vcs.overrides_key
|
72
|
+
if (overrides_key = pkg_set.vcs.overrides_key)
|
73
73
|
puts " overrides key: pkg_set:#{overrides_key}"
|
74
74
|
end
|
75
|
-
if pkg_set.raw_local_dir
|
75
|
+
if pkg_set.raw_local_dir == pkg_set.user_local_dir
|
76
|
+
puts " path: #{pkg_set.raw_local_dir}"
|
77
|
+
else
|
76
78
|
puts " checkout dir: #{pkg_set.raw_local_dir}"
|
77
79
|
puts " symlinked to: #{pkg_set.user_local_dir}"
|
78
|
-
else
|
79
|
-
puts " path: #{pkg_set.raw_local_dir}"
|
80
80
|
end
|
81
81
|
|
82
82
|
puts " version control information:"
|
@@ -87,20 +87,20 @@ module Autoproj
|
|
87
87
|
if size == 0
|
88
88
|
puts " does not have any packages"
|
89
89
|
else
|
90
|
-
|
90
|
+
plural = metapackage.size > 1 ? "s" : ""
|
91
|
+
puts " refers to #{metapackage.size} package#{plural}"
|
91
92
|
end
|
92
93
|
names = metapackage.each_package.map(&:name).sort
|
93
94
|
package_lines = names.each_slice(package_per_line).map do |*line_names|
|
94
95
|
line_names.join(", ")
|
95
96
|
end
|
96
|
-
puts "
|
97
|
-
|
97
|
+
puts " #{package_lines.join(",\n ")}"
|
98
98
|
end
|
99
99
|
|
100
100
|
def display_source_package(pkg_name, default_packages, revdeps, options = Hash.new)
|
101
101
|
puts Autoproj.color("source package #{pkg_name}", :bold)
|
102
102
|
pkg = ws.manifest.find_autobuild_package(pkg_name)
|
103
|
-
|
103
|
+
unless File.directory?(pkg.srcdir)
|
104
104
|
puts Autobuild.color(" this package is not checked out yet, the dependency information will probably be incomplete", :magenta)
|
105
105
|
end
|
106
106
|
puts " source definition"
|
@@ -110,9 +110,9 @@ module Autoproj
|
|
110
110
|
display_vcs(vcs)
|
111
111
|
display_common_information(pkg_name, default_packages, revdeps)
|
112
112
|
|
113
|
-
puts " directly depends on: #{pkg.dependencies.sort.join(
|
114
|
-
puts " optionally depends on: #{pkg.optional_dependencies.sort.join(
|
115
|
-
puts " dependencies on OS packages: #{pkg.os_packages.sort.join(
|
113
|
+
puts " directly depends on: #{pkg.dependencies.sort.join(', ')}"
|
114
|
+
puts " optionally depends on: #{pkg.optional_dependencies.sort.join(', ')}"
|
115
|
+
puts " dependencies on OS packages: #{pkg.os_packages.sort.join(', ')}"
|
116
116
|
if options[:env]
|
117
117
|
puts " environment"
|
118
118
|
pkg.resolved_env.sort_by(&:first).each do |name, v|
|
@@ -141,14 +141,15 @@ module Autoproj
|
|
141
141
|
if entry.package_set && entry.file
|
142
142
|
"#{entry.package_set.name} (#{entry.file})"
|
143
143
|
elsif entry.package_set
|
144
|
-
|
144
|
+
entry.package_set.name.to_s
|
145
145
|
elsif entry.file
|
146
|
-
|
146
|
+
entry.file.to_s
|
147
147
|
end
|
148
148
|
|
149
149
|
title = if first
|
150
150
|
"first match: in #{entry_name}"
|
151
|
-
else
|
151
|
+
else
|
152
|
+
"overriden in #{entry_name}"
|
152
153
|
end
|
153
154
|
first = false
|
154
155
|
fragments << [title, vcs_to_array(entry.vcs)]
|
@@ -172,26 +173,25 @@ module Autoproj
|
|
172
173
|
puts Autoproj.color("the osdep '#{pkg_name}'", :bold)
|
173
174
|
begin
|
174
175
|
ws.os_package_resolver.resolve_os_packages([pkg_name]).each do |manager_name, packages|
|
175
|
-
puts " #{manager_name}: #{packages.map { |*subnames| subnames.join(
|
176
|
+
puts " #{manager_name}: #{packages.map { |*subnames| subnames.join(' ') }.join(', ')}"
|
176
177
|
end
|
177
178
|
rescue MissingOSDep => e
|
178
179
|
puts " #{e.message}"
|
179
180
|
end
|
180
181
|
|
181
|
-
|
182
|
+
unless selected
|
182
183
|
puts " is present, but won't be used by autoproj for '#{pkg_name}'"
|
183
184
|
end
|
184
185
|
|
185
186
|
entries = ws.os_package_resolver.all_definitions[pkg_name]
|
186
187
|
puts " #{entries.inject(0) { |c, (files, _)| c + files.size }} matching entries:"
|
187
188
|
entries.each do |files, entry|
|
188
|
-
puts " in #{files.join(
|
189
|
+
puts " in #{files.join(', ')}:"
|
189
190
|
lines = YAML.dump(entry).split("\n")
|
190
|
-
lines[0] = lines[0].gsub(/---\s*/,
|
191
|
-
if lines[0].empty?
|
192
|
-
|
193
|
-
|
194
|
-
puts " " + lines.join("\n ")
|
191
|
+
lines[0] = lines[0].gsub(/---\s*/, "")
|
192
|
+
lines.shift if lines[0].empty?
|
193
|
+
|
194
|
+
puts " #{lines.join("\n ")}"
|
195
195
|
end
|
196
196
|
display_common_information(pkg_name, default_packages, revdeps)
|
197
197
|
end
|
@@ -204,14 +204,12 @@ module Autoproj
|
|
204
204
|
else
|
205
205
|
layout_selection = layout_selection.dup
|
206
206
|
layout_selection.delete(pkg_name)
|
207
|
-
puts " is directly selected by the manifest via #{layout_selection.to_a.join(
|
207
|
+
puts " is directly selected by the manifest via #{layout_selection.to_a.join(', ')}"
|
208
208
|
end
|
209
209
|
else
|
210
210
|
puts " is not directly selected by the manifest"
|
211
211
|
end
|
212
|
-
if ws.manifest.ignored?(pkg_name)
|
213
|
-
puts " is ignored"
|
214
|
-
end
|
212
|
+
puts " is ignored" if ws.manifest.ignored?(pkg_name)
|
215
213
|
if ws.manifest.excluded?(pkg_name)
|
216
214
|
puts " is excluded: #{Autoproj.manifest.exclusion_reason(pkg_name)}"
|
217
215
|
end
|
@@ -221,8 +219,8 @@ module Autoproj
|
|
221
219
|
if pkg_revdeps.empty?
|
222
220
|
puts " no reverse dependencies"
|
223
221
|
else
|
224
|
-
puts " direct reverse dependencies: #{pkg_revdeps.sort.join(
|
225
|
-
puts " recursive reverse dependencies: #{all_revdeps.sort.join(
|
222
|
+
puts " direct reverse dependencies: #{pkg_revdeps.sort.join(', ')}"
|
223
|
+
puts " recursive reverse dependencies: #{all_revdeps.sort.join(', ')}"
|
226
224
|
end
|
227
225
|
|
228
226
|
selections = Set.new
|
@@ -241,7 +239,7 @@ module Autoproj
|
|
241
239
|
puts " FAILED"
|
242
240
|
else
|
243
241
|
paths.sort.uniq.each do |p|
|
244
|
-
puts " #{p.join(
|
242
|
+
puts " #{p.join('>')}"
|
245
243
|
end
|
246
244
|
end
|
247
245
|
end
|
@@ -256,7 +254,8 @@ module Autoproj
|
|
256
254
|
next if pkg_type != :package
|
257
255
|
|
258
256
|
path = if pkg_name == from then []
|
259
|
-
else
|
257
|
+
else
|
258
|
+
[pkg_name]
|
260
259
|
end
|
261
260
|
|
262
261
|
pkg = ws.manifest.find_autobuild_package(pkg_name)
|
@@ -285,8 +284,8 @@ module Autoproj
|
|
285
284
|
def vcs_to_array(vcs)
|
286
285
|
if vcs.kind_of?(Hash)
|
287
286
|
options = vcs.dup
|
288
|
-
type = options.delete(
|
289
|
-
url = options.delete(
|
287
|
+
type = options.delete("type")
|
288
|
+
url = options.delete("url")
|
290
289
|
else
|
291
290
|
options = vcs.options
|
292
291
|
type = vcs.type
|
@@ -294,8 +293,8 @@ module Autoproj
|
|
294
293
|
end
|
295
294
|
|
296
295
|
fields = []
|
297
|
-
fields << [
|
298
|
-
fields << [
|
296
|
+
fields << ["type", type] if type
|
297
|
+
fields << ["url", url] if url
|
299
298
|
fields = fields.concat(options.to_a.sort_by { |k, _| k.to_s })
|
300
299
|
fields.map do |key, value|
|
301
300
|
if value.respond_to?(:to_str) && File.file?(value) && value =~ /^\//
|
data/lib/autoproj/cli/status.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "autoproj/cli/inspection_tool"
|
2
|
+
require "tty-spinner"
|
3
3
|
|
4
4
|
module Autoproj
|
5
5
|
module CLI
|
@@ -7,27 +7,24 @@ module Autoproj
|
|
7
7
|
def validate_options(packages, options)
|
8
8
|
packages, options = super
|
9
9
|
options[:progress] = Autobuild.progress_display_enabled?
|
10
|
-
if options[:no_deps_shortcut]
|
11
|
-
|
12
|
-
|
13
|
-
if options[:deps].nil? && packages.empty?
|
14
|
-
options[:deps] = true
|
15
|
-
end
|
16
|
-
return packages, options
|
10
|
+
options[:deps] = false if options[:no_deps_shortcut]
|
11
|
+
options[:deps] = true if options[:deps].nil? && packages.empty?
|
12
|
+
[packages, options]
|
17
13
|
end
|
18
14
|
|
19
15
|
def run(user_selection, options = Hash.new)
|
20
16
|
initialize_and_load(mainline: options[:mainline])
|
21
17
|
packages, *, config_selected = finalize_setup(
|
22
18
|
user_selection,
|
23
|
-
recursive: options[:deps]
|
19
|
+
recursive: options[:deps]
|
20
|
+
)
|
24
21
|
|
25
22
|
if options[:config].nil?
|
26
23
|
options[:config] = user_selection.empty? || config_selected
|
27
24
|
end
|
28
25
|
|
29
26
|
if packages.empty?
|
30
|
-
Autoproj.error "no packages or OS packages match #{user_selection.join(
|
27
|
+
Autoproj.error "no packages or OS packages match #{user_selection.join(' ')}"
|
31
28
|
return
|
32
29
|
end
|
33
30
|
|
@@ -39,14 +36,15 @@ module Autoproj
|
|
39
36
|
|
40
37
|
if options[:config]
|
41
38
|
pkg_sets = ws.manifest.each_package_set.to_a
|
42
|
-
|
39
|
+
unless pkg_sets.empty?
|
43
40
|
Autoproj.message("autoproj: displaying status of configuration", :bold)
|
44
41
|
display_status(
|
45
42
|
pkg_sets,
|
46
43
|
parallel: options[:parallel],
|
47
44
|
snapshot: options[:snapshot],
|
48
45
|
only_local: options[:only_local],
|
49
|
-
progress: options[:progress]
|
46
|
+
progress: options[:progress]
|
47
|
+
)
|
50
48
|
|
51
49
|
STDERR.puts
|
52
50
|
end
|
@@ -61,7 +59,8 @@ module Autoproj
|
|
61
59
|
parallel: options[:parallel],
|
62
60
|
snapshot: options[:snapshot],
|
63
61
|
only_local: options[:only_local],
|
64
|
-
progress: options[:progress]
|
62
|
+
progress: options[:progress]
|
63
|
+
)
|
65
64
|
end
|
66
65
|
|
67
66
|
def snapshot_overrides_vcs?(importer, vcs, snapshot)
|
@@ -73,7 +72,7 @@ module Autoproj
|
|
73
72
|
end
|
74
73
|
end
|
75
74
|
|
76
|
-
def report_exception(package_status, msg, e)
|
75
|
+
def self.report_exception(package_status, msg, e)
|
77
76
|
package_status.msg << Autoproj.color(" #{msg} (#{e})", :red)
|
78
77
|
if Autobuild.debug
|
79
78
|
package_status.msg.concat(e.backtrace.map do |line|
|
@@ -82,8 +81,8 @@ module Autoproj
|
|
82
81
|
end
|
83
82
|
end
|
84
83
|
|
85
|
-
PackageStatus = Struct.new :msg, :sync, :uncommitted, :local, :remote
|
86
|
-
def status_of_package(package_description, only_local: false, snapshot: false)
|
84
|
+
PackageStatus = Struct.new :msg, :sync, :unexpected, :uncommitted, :local, :remote
|
85
|
+
def self.status_of_package(package_description, only_local: false, snapshot: false)
|
87
86
|
pkg = package_description.autobuild
|
88
87
|
importer = pkg.importer
|
89
88
|
package_status = PackageStatus.new(Array.new, false, false, false, false)
|
@@ -100,8 +99,8 @@ module Autoproj
|
|
100
99
|
return package_status
|
101
100
|
end
|
102
101
|
|
103
|
-
snapshot_useful = [Autobuild::Importer::Status::ADVANCED, Autobuild::Importer::Status::NEEDS_MERGE]
|
104
|
-
|
102
|
+
snapshot_useful = [Autobuild::Importer::Status::ADVANCED, Autobuild::Importer::Status::NEEDS_MERGE]
|
103
|
+
.include?(status.status)
|
105
104
|
if snapshot && snapshot_useful && importer.respond_to?(:snapshot)
|
106
105
|
snapshot_version =
|
107
106
|
begin importer.snapshot(pkg, nil, exact_state: false, only_local: only_local)
|
@@ -113,7 +112,7 @@ module Autoproj
|
|
113
112
|
end
|
114
113
|
if snapshot_overrides_vcs?(importer, package_description.vcs, snapshot_version)
|
115
114
|
non_nil_values = snapshot_version.delete_if { |k, v| !v }
|
116
|
-
package_status.msg << Autoproj.color(" found configuration that contains all local changes: #{non_nil_values.sort_by(&:first).map { |k, v| "#{k}: #{v}" }.join(
|
115
|
+
package_status.msg << Autoproj.color(" found configuration that contains all local changes: #{non_nil_values.sort_by(&:first).map { |k, v| "#{k}: #{v}" }.join(', ')}", :bright_green)
|
117
116
|
package_status.msg << Autoproj.color(" consider adding this to your overrides, or use autoproj versions to do it for you", :bright_green)
|
118
117
|
if snapshot
|
119
118
|
importer.relocate(importer.repository, snapshot_version)
|
@@ -122,6 +121,7 @@ module Autoproj
|
|
122
121
|
end
|
123
122
|
|
124
123
|
status.unexpected_working_copy_state.each do |msg|
|
124
|
+
package_status.unexpected = true
|
125
125
|
package_status.msg << Autoproj.color(" #{msg}", :red, :bold)
|
126
126
|
end
|
127
127
|
|
@@ -162,29 +162,40 @@ module Autoproj
|
|
162
162
|
package_status
|
163
163
|
end
|
164
164
|
|
165
|
-
def each_package_status(
|
166
|
-
|
165
|
+
def each_package_status(
|
166
|
+
packages,
|
167
|
+
parallel: ws.config.parallel_import_level,
|
168
|
+
snapshot: false, only_local: false, progress: nil
|
169
|
+
)
|
170
|
+
unless block_given?
|
171
|
+
return enum_for(
|
172
|
+
__method__, packages,
|
173
|
+
parallel: parallel, snapshot: snapshot, only_local: only_local,
|
174
|
+
progress: progress
|
175
|
+
)
|
176
|
+
end
|
167
177
|
|
168
178
|
result = StatusResult.new
|
169
179
|
|
170
180
|
executor = Concurrent::FixedThreadPool.new(parallel, max_length: 0)
|
171
|
-
interactive, noninteractive =
|
172
|
-
|
173
|
-
end
|
181
|
+
interactive, noninteractive =
|
182
|
+
packages.partition { |pkg| pkg.autobuild.importer&.interactive? }
|
174
183
|
noninteractive = noninteractive.map do |pkg|
|
175
|
-
future = Concurrent::
|
176
|
-
status_of_package(
|
184
|
+
future = Concurrent::Promises.future_on(executor) do
|
185
|
+
Status.status_of_package(
|
186
|
+
pkg, snapshot: snapshot, only_local: only_local
|
187
|
+
)
|
177
188
|
end
|
178
189
|
[pkg, future]
|
179
190
|
end
|
180
191
|
|
181
192
|
(noninteractive + interactive).each do |pkg, future|
|
182
|
-
if future
|
193
|
+
if future
|
183
194
|
if progress
|
184
195
|
wait_timeout = 1
|
185
|
-
|
186
|
-
future.wait(wait_timeout)
|
187
|
-
if future.
|
196
|
+
loop do
|
197
|
+
future.wait!(wait_timeout)
|
198
|
+
if future.resolved?
|
188
199
|
break
|
189
200
|
else
|
190
201
|
wait_timeout = 0.2
|
@@ -193,10 +204,13 @@ module Autoproj
|
|
193
204
|
end
|
194
205
|
end
|
195
206
|
|
196
|
-
|
207
|
+
unless (status = future.value)
|
197
208
|
raise future.reason
|
198
209
|
end
|
199
|
-
else
|
210
|
+
else
|
211
|
+
status = Status.status_of_package(
|
212
|
+
pkg, snapshot: snapshot, only_local: only_local
|
213
|
+
)
|
200
214
|
end
|
201
215
|
|
202
216
|
result.uncommitted ||= status.uncommitted
|
@@ -205,7 +219,6 @@ module Autoproj
|
|
205
219
|
yield(pkg, status)
|
206
220
|
end
|
207
221
|
result
|
208
|
-
|
209
222
|
rescue Interrupt
|
210
223
|
Autoproj.warn "Interrupted, waiting for pending jobs to finish"
|
211
224
|
raise
|
@@ -224,9 +237,9 @@ module Autoproj
|
|
224
237
|
|
225
238
|
if progress
|
226
239
|
progress = lambda do |pkg|
|
227
|
-
|
228
|
-
|
229
|
-
Autoproj.message("#{sync_packages}: #{Autoproj.color(
|
240
|
+
unless spinner
|
241
|
+
unless sync_packages.empty?
|
242
|
+
Autoproj.message("#{sync_packages}: #{Autoproj.color('local and remote are in sync', :green)}")
|
230
243
|
sync_packages = ""
|
231
244
|
end
|
232
245
|
|
@@ -258,12 +271,12 @@ module Autoproj
|
|
258
271
|
next
|
259
272
|
end
|
260
273
|
|
261
|
-
|
262
|
-
Autoproj.message("#{sync_packages}: #{Autoproj.color(
|
274
|
+
unless sync_packages.empty?
|
275
|
+
Autoproj.message("#{sync_packages}: #{Autoproj.color('local and remote are in sync', :green)}")
|
263
276
|
sync_packages = ""
|
264
277
|
end
|
265
278
|
|
266
|
-
STDERR.print
|
279
|
+
STDERR.print
|
267
280
|
|
268
281
|
if status.msg.size == 1
|
269
282
|
Autoproj.message "#{pkg_name}: #{status.msg.first}"
|
@@ -274,12 +287,11 @@ module Autoproj
|
|
274
287
|
end
|
275
288
|
end
|
276
289
|
end
|
277
|
-
|
278
|
-
Autoproj.message("#{sync_packages}: #{Autoproj.color(
|
290
|
+
unless sync_packages.empty?
|
291
|
+
Autoproj.message("#{sync_packages}: #{Autoproj.color('local and remote are in sync', :green)}")
|
279
292
|
end
|
280
|
-
|
293
|
+
result
|
281
294
|
end
|
282
295
|
end
|
283
296
|
end
|
284
297
|
end
|
285
|
-
|
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
1
|
+
require "autoproj"
|
2
|
+
require "autoproj/cli/base"
|
3
|
+
require "autoproj/cli/update"
|
4
|
+
require "autoproj/ops/main_config_switcher"
|
5
|
+
require "autoproj/ops/configuration"
|
6
6
|
|
7
7
|
module Autoproj
|
8
8
|
module CLI
|
@@ -29,4 +29,3 @@ module Autoproj
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
32
|
-
|
data/lib/autoproj/cli/tag.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
1
|
+
require "autoproj"
|
2
|
+
require "autoproj/cli/versions"
|
3
|
+
require "autoproj/ops/snapshot"
|
4
|
+
require "autoproj/cli/base"
|
5
5
|
|
6
6
|
module Autoproj
|
7
7
|
module CLI
|
@@ -19,21 +19,23 @@ module Autoproj
|
|
19
19
|
|
20
20
|
versions_file = File.join(
|
21
21
|
Workspace::OVERRIDES_DIR,
|
22
|
-
Versions::DEFAULT_VERSIONS_FILE_BASENAME
|
22
|
+
Versions::DEFAULT_VERSIONS_FILE_BASENAME
|
23
|
+
)
|
23
24
|
|
24
25
|
if tag_name.nil?
|
25
26
|
importer = pkg.importer
|
26
|
-
all_tags = importer.run_git_bare(pkg,
|
27
|
+
all_tags = importer.run_git_bare(pkg, "tag")
|
27
28
|
all_tags.sort.each do |tag|
|
28
29
|
next if tag =~ /\^/
|
30
|
+
|
29
31
|
begin importer.show(pkg, "refs/tags/#{tag}", versions_file)
|
30
|
-
|
32
|
+
puts tag
|
31
33
|
rescue Autobuild::PackageException
|
32
34
|
end
|
33
35
|
end
|
34
36
|
return
|
35
37
|
end
|
36
|
-
|
38
|
+
|
37
39
|
# Check if the tag already exists
|
38
40
|
begin
|
39
41
|
importer.rev_parse(pkg, "refs/tags/#{tag_name}")
|
@@ -42,7 +44,7 @@ module Autoproj
|
|
42
44
|
end
|
43
45
|
|
44
46
|
message = options[:message] ||
|
45
|
-
|
47
|
+
"autoproj created tag #{tag_name}"
|
46
48
|
commit_id = Ops::Snapshot.create_commit(pkg, versions_file, message) do |io|
|
47
49
|
versions = CLI::Versions.new(ws)
|
48
50
|
Autoproj.message "creating versions file, this may take a while"
|
@@ -53,9 +55,8 @@ module Autoproj
|
|
53
55
|
keep_going: options[:keep_going])
|
54
56
|
end
|
55
57
|
|
56
|
-
importer.run_git_bare(pkg,
|
58
|
+
importer.run_git_bare(pkg, "tag", tag_name, commit_id)
|
57
59
|
end
|
58
60
|
end
|
59
61
|
end
|
60
62
|
end
|
61
|
-
|
data/lib/autoproj/cli/test.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
require
|
1
|
+
require "autoproj/cli/utility"
|
2
2
|
|
3
3
|
module Autoproj
|
4
4
|
module CLI
|
5
5
|
class Test < Utility
|
6
6
|
def initialize(ws = Workspace.default,
|
7
|
-
|
8
|
-
|
7
|
+
name: "test",
|
8
|
+
report_path: ws.utility_report_path("test"))
|
9
9
|
super
|
10
10
|
end
|
11
11
|
|
12
12
|
def package_metadata(package)
|
13
13
|
u = package.test_utility
|
14
14
|
super.merge(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
"coverage_available" => !!u.coverage_available?,
|
16
|
+
"coverage_enabled" => !!u.coverage_enabled?,
|
17
|
+
"coverage_source_dir" => u.coverage_source_dir,
|
18
|
+
"coverage_target_dir" => u.coverage_target_dir
|
19
19
|
)
|
20
20
|
end
|
21
21
|
end
|