autoproj 2.14.0 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/lint.yml +25 -0
  3. data/.github/workflows/test.yml +30 -0
  4. data/.rubocop.yml +79 -91
  5. data/.rubocop_todo.yml +1473 -0
  6. data/Gemfile +9 -9
  7. data/Rakefile +24 -24
  8. data/autoproj.gemspec +22 -22
  9. data/bin/alocate +4 -4
  10. data/bin/alog +5 -7
  11. data/bin/amake +4 -4
  12. data/bin/aup +4 -4
  13. data/bin/autoproj +3 -3
  14. data/bin/autoproj_bootstrap +185 -182
  15. data/bin/autoproj_bootstrap.in +7 -8
  16. data/bin/autoproj_install +184 -181
  17. data/bin/autoproj_install.in +6 -7
  18. data/lib/autoproj/aruba_minitest.rb +6 -11
  19. data/lib/autoproj/autobuild.rb +5 -6
  20. data/lib/autoproj/autobuild_extensions/archive_importer.rb +10 -11
  21. data/lib/autoproj/autobuild_extensions/dsl.rb +38 -34
  22. data/lib/autoproj/autobuild_extensions/git.rb +27 -26
  23. data/lib/autoproj/autobuild_extensions/package.rb +23 -22
  24. data/lib/autoproj/autobuild_extensions/svn.rb +1 -2
  25. data/lib/autoproj/base.rb +1 -1
  26. data/lib/autoproj/bash_completion.rb +5 -6
  27. data/lib/autoproj/build_option.rb +22 -24
  28. data/lib/autoproj/cli/base.rb +26 -26
  29. data/lib/autoproj/cli/bootstrap.rb +14 -16
  30. data/lib/autoproj/cli/build.rb +10 -7
  31. data/lib/autoproj/cli/cache.rb +11 -11
  32. data/lib/autoproj/cli/clean.rb +10 -10
  33. data/lib/autoproj/cli/commit.rb +7 -8
  34. data/lib/autoproj/cli/doc.rb +2 -2
  35. data/lib/autoproj/cli/envsh.rb +1 -2
  36. data/lib/autoproj/cli/exec.rb +60 -20
  37. data/lib/autoproj/cli/inspection_tool.rb +13 -7
  38. data/lib/autoproj/cli/locate.rb +30 -41
  39. data/lib/autoproj/cli/log.rb +7 -7
  40. data/lib/autoproj/cli/main.rb +213 -204
  41. data/lib/autoproj/cli/main_doc.rb +22 -21
  42. data/lib/autoproj/cli/main_global.rb +44 -19
  43. data/lib/autoproj/cli/main_plugin.rb +18 -18
  44. data/lib/autoproj/cli/main_test.rb +28 -27
  45. data/lib/autoproj/cli/manifest.rb +7 -7
  46. data/lib/autoproj/cli/osdeps.rb +12 -11
  47. data/lib/autoproj/cli/patcher.rb +2 -3
  48. data/lib/autoproj/cli/query.rb +17 -18
  49. data/lib/autoproj/cli/reconfigure.rb +1 -2
  50. data/lib/autoproj/cli/reset.rb +9 -12
  51. data/lib/autoproj/cli/show.rb +38 -39
  52. data/lib/autoproj/cli/status.rb +45 -39
  53. data/lib/autoproj/cli/switch_config.rb +5 -6
  54. data/lib/autoproj/cli/tag.rb +12 -11
  55. data/lib/autoproj/cli/test.rb +7 -7
  56. data/lib/autoproj/cli/update.rb +35 -37
  57. data/lib/autoproj/cli/utility.rb +11 -10
  58. data/lib/autoproj/cli/version.rb +42 -40
  59. data/lib/autoproj/cli/versions.rb +14 -15
  60. data/lib/autoproj/cli/watch.rb +33 -37
  61. data/lib/autoproj/cli/which.rb +16 -20
  62. data/lib/autoproj/cli.rb +4 -2
  63. data/lib/autoproj/configuration.rb +77 -84
  64. data/lib/autoproj/environment.rb +28 -13
  65. data/lib/autoproj/exceptions.rb +9 -3
  66. data/lib/autoproj/find_workspace.rb +20 -25
  67. data/lib/autoproj/git_server_configuration.rb +40 -44
  68. data/lib/autoproj/gitorious.rb +1 -1
  69. data/lib/autoproj/installation_manifest.rb +64 -29
  70. data/lib/autoproj/local_package_set.rb +13 -11
  71. data/lib/autoproj/manifest.rb +132 -130
  72. data/lib/autoproj/metapackage.rb +2 -6
  73. data/lib/autoproj/ops/atomic_write.rb +7 -6
  74. data/lib/autoproj/ops/build.rb +4 -6
  75. data/lib/autoproj/ops/cache.rb +41 -43
  76. data/lib/autoproj/ops/cached_env.rb +5 -4
  77. data/lib/autoproj/ops/configuration.rb +511 -506
  78. data/lib/autoproj/ops/import.rb +73 -63
  79. data/lib/autoproj/ops/install.rb +178 -174
  80. data/lib/autoproj/ops/loader.rb +77 -76
  81. data/lib/autoproj/ops/main_config_switcher.rb +36 -45
  82. data/lib/autoproj/ops/phase_reporting.rb +4 -4
  83. data/lib/autoproj/ops/snapshot.rb +250 -247
  84. data/lib/autoproj/ops/tools.rb +76 -78
  85. data/lib/autoproj/ops/watch.rb +6 -6
  86. data/lib/autoproj/ops/which.rb +17 -14
  87. data/lib/autoproj/options.rb +13 -2
  88. data/lib/autoproj/os_package_installer.rb +102 -92
  89. data/lib/autoproj/os_package_query.rb +7 -13
  90. data/lib/autoproj/os_package_resolver.rb +189 -140
  91. data/lib/autoproj/os_repository_installer.rb +4 -4
  92. data/lib/autoproj/os_repository_resolver.rb +8 -6
  93. data/lib/autoproj/package_definition.rb +12 -13
  94. data/lib/autoproj/package_managers/apt_dpkg_manager.rb +10 -10
  95. data/lib/autoproj/package_managers/bundler_manager.rb +147 -111
  96. data/lib/autoproj/package_managers/debian_version.rb +25 -21
  97. data/lib/autoproj/package_managers/emerge_manager.rb +2 -3
  98. data/lib/autoproj/package_managers/gem_manager.rb +68 -77
  99. data/lib/autoproj/package_managers/homebrew_manager.rb +3 -4
  100. data/lib/autoproj/package_managers/manager.rb +8 -3
  101. data/lib/autoproj/package_managers/pacman_manager.rb +2 -3
  102. data/lib/autoproj/package_managers/pip_manager.rb +20 -22
  103. data/lib/autoproj/package_managers/pkg_manager.rb +3 -4
  104. data/lib/autoproj/package_managers/port_manager.rb +2 -3
  105. data/lib/autoproj/package_managers/shell_script_manager.rb +32 -22
  106. data/lib/autoproj/package_managers/unknown_os_manager.rb +5 -8
  107. data/lib/autoproj/package_managers/yum_manager.rb +12 -15
  108. data/lib/autoproj/package_managers/zypper_manager.rb +11 -14
  109. data/lib/autoproj/package_manifest.rb +27 -26
  110. data/lib/autoproj/package_selection.rb +187 -187
  111. data/lib/autoproj/package_set.rb +127 -113
  112. data/lib/autoproj/python.rb +55 -55
  113. data/lib/autoproj/query_base.rb +20 -14
  114. data/lib/autoproj/reporter.rb +19 -19
  115. data/lib/autoproj/repository_managers/apt.rb +101 -67
  116. data/lib/autoproj/repository_managers/unknown_os_manager.rb +3 -3
  117. data/lib/autoproj/shell_completion.rb +16 -13
  118. data/lib/autoproj/source_package_query.rb +29 -36
  119. data/lib/autoproj/system.rb +32 -21
  120. data/lib/autoproj/test.rb +127 -104
  121. data/lib/autoproj/variable_expansion.rb +7 -9
  122. data/lib/autoproj/vcs_definition.rb +35 -32
  123. data/lib/autoproj/version.rb +1 -1
  124. data/lib/autoproj/workspace.rb +123 -107
  125. data/lib/autoproj/zsh_completion.rb +8 -9
  126. data/lib/autoproj.rb +53 -55
  127. data/samples/autoproj/init.rb +1 -2
  128. metadata +53 -51
  129. data/.travis.yml +0 -24
@@ -1,5 +1,5 @@
1
- require 'autoproj'
2
- require 'autoproj/cli/inspection_tool'
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 ? "not selected" : "selected"})"
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
- if !File.directory?(pkg_set.raw_local_dir)
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 != pkg_set.user_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
- puts " refers to #{metapackage.size} package#{'s' if metapackage.size > 1}"
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 " " + package_lines.join(",\n ")
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
- if !File.directory?(pkg.srcdir)
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
- "#{entry.package_set.name}"
144
+ entry.package_set.name.to_s
145
145
  elsif entry.file
146
- "#{entry.file}"
146
+ entry.file.to_s
147
147
  end
148
148
 
149
149
  title = if first
150
150
  "first match: in #{entry_name}"
151
- else "overriden in #{entry_name}"
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(" ") }.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
- if !selected
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
- lines.shift
193
- end
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 [pkg_name]
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('type')
289
- url = options.delete('url')
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 << ['type', type] if type
298
- fields << ['url', url] if url
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 =~ /^\//
@@ -1,5 +1,5 @@
1
- require 'autoproj/cli/inspection_tool'
2
- require 'tty-spinner'
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
- options[:deps] = false
12
- end
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
- if !pkg_sets.empty?
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)
@@ -96,24 +95,24 @@ module Autoproj
96
95
  else
97
96
  begin status = importer.status(pkg, only_local: only_local)
98
97
  rescue StandardError => e
99
- self.report_exception(package_status, "failed to fetch status information", e)
98
+ report_exception(package_status, "failed to fetch status information", e)
100
99
  return package_status
101
100
  end
102
101
 
103
- snapshot_useful = [Autobuild::Importer::Status::ADVANCED, Autobuild::Importer::Status::NEEDS_MERGE].
104
- include?(status.status)
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)
108
107
  rescue Autobuild::PackageException
109
108
  Hash.new
110
109
  rescue StandardError => e
111
- self.report_exception(package_status, "failed to fetch snapshotting information", e)
110
+ report_exception(package_status, "failed to fetch snapshotting information", e)
112
111
  return package_status
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(", ")}", :bright_green)
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)
@@ -163,17 +162,26 @@ module Autoproj
163
162
  package_status
164
163
  end
165
164
 
166
- def each_package_status(packages, parallel: ws.config.parallel_import_level, snapshot: false, only_local: false, progress: nil)
167
- return enum_for(__method__) if !block_given?
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
168
177
 
169
178
  result = StatusResult.new
170
179
 
171
180
  executor = Concurrent::FixedThreadPool.new(parallel, max_length: 0)
172
- interactive, noninteractive = packages.partition do |pkg|
173
- pkg.autobuild.importer && pkg.autobuild.importer.interactive?
174
- end
181
+ interactive, noninteractive =
182
+ packages.partition { |pkg| pkg.autobuild.importer&.interactive? }
175
183
  noninteractive = noninteractive.map do |pkg|
176
- future = Concurrent::Future.execute(executor: executor) do
184
+ future = Concurrent::Promises.future_on(executor) do
177
185
  Status.status_of_package(
178
186
  pkg, snapshot: snapshot, only_local: only_local
179
187
  )
@@ -185,9 +193,9 @@ module Autoproj
185
193
  if future
186
194
  if progress
187
195
  wait_timeout = 1
188
- while true
189
- future.wait(wait_timeout)
190
- if future.complete?
196
+ loop do
197
+ future.wait!(wait_timeout)
198
+ if future.resolved?
191
199
  break
192
200
  else
193
201
  wait_timeout = 0.2
@@ -196,7 +204,7 @@ module Autoproj
196
204
  end
197
205
  end
198
206
 
199
- if !(status = future.value)
207
+ unless (status = future.value)
200
208
  raise future.reason
201
209
  end
202
210
  else
@@ -211,7 +219,6 @@ module Autoproj
211
219
  yield(pkg, status)
212
220
  end
213
221
  result
214
-
215
222
  rescue Interrupt
216
223
  Autoproj.warn "Interrupted, waiting for pending jobs to finish"
217
224
  raise
@@ -230,9 +237,9 @@ module Autoproj
230
237
 
231
238
  if progress
232
239
  progress = lambda do |pkg|
233
- if !spinner
234
- if !sync_packages.empty?
235
- Autoproj.message("#{sync_packages}: #{Autoproj.color("local and remote are in sync", :green)}")
240
+ unless spinner
241
+ unless sync_packages.empty?
242
+ Autoproj.message("#{sync_packages}: #{Autoproj.color('local and remote are in sync', :green)}")
236
243
  sync_packages = ""
237
244
  end
238
245
 
@@ -264,8 +271,8 @@ module Autoproj
264
271
  next
265
272
  end
266
273
 
267
- if !sync_packages.empty?
268
- Autoproj.message("#{sync_packages}: #{Autoproj.color("local and remote are in sync", :green)}")
274
+ unless sync_packages.empty?
275
+ Autoproj.message("#{sync_packages}: #{Autoproj.color('local and remote are in sync', :green)}")
269
276
  sync_packages = ""
270
277
  end
271
278
 
@@ -280,12 +287,11 @@ module Autoproj
280
287
  end
281
288
  end
282
289
  end
283
- if !sync_packages.empty?
284
- Autoproj.message("#{sync_packages}: #{Autoproj.color("local and remote are in sync", :green)}")
290
+ unless sync_packages.empty?
291
+ Autoproj.message("#{sync_packages}: #{Autoproj.color('local and remote are in sync', :green)}")
285
292
  end
286
- return result
293
+ result
287
294
  end
288
295
  end
289
296
  end
290
297
  end
291
-
@@ -1,8 +1,8 @@
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'
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
-
@@ -1,7 +1,7 @@
1
- require 'autoproj'
2
- require 'autoproj/cli/versions'
3
- require 'autoproj/ops/snapshot'
4
- require 'autoproj/cli/base'
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, 'tag')
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
- puts tag
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
- "autoproj created tag #{tag_name}"
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, 'tag', tag_name, commit_id)
58
+ importer.run_git_bare(pkg, "tag", tag_name, commit_id)
57
59
  end
58
60
  end
59
61
  end
60
62
  end
61
-
@@ -1,21 +1,21 @@
1
- require 'autoproj/cli/utility'
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
- name: 'test',
8
- report_path: ws.utility_report_path('test'))
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
- '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
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