autoproj 2.12.1 → 2.15.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (133) 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 +24 -22
  9. data/bin/alocate +4 -4
  10. data/bin/alog +6 -7
  11. data/bin/amake +4 -4
  12. data/bin/aup +4 -4
  13. data/bin/autoproj +3 -3
  14. data/bin/autoproj_bootstrap +225 -200
  15. data/bin/autoproj_bootstrap.in +7 -8
  16. data/bin/autoproj_install +224 -199
  17. data/bin/autoproj_install.in +6 -7
  18. data/lib/autoproj/aruba_minitest.rb +6 -11
  19. data/lib/autoproj/autobuild.rb +9 -6
  20. data/lib/autoproj/autobuild_extensions/archive_importer.rb +10 -11
  21. data/lib/autoproj/autobuild_extensions/dsl.rb +66 -36
  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/python.rb +18 -0
  25. data/lib/autoproj/autobuild_extensions/svn.rb +1 -2
  26. data/lib/autoproj/base.rb +1 -1
  27. data/lib/autoproj/bash_completion.rb +5 -6
  28. data/lib/autoproj/build_option.rb +22 -24
  29. data/lib/autoproj/cli/base.rb +26 -26
  30. data/lib/autoproj/cli/bootstrap.rb +14 -16
  31. data/lib/autoproj/cli/build.rb +10 -7
  32. data/lib/autoproj/cli/cache.rb +11 -11
  33. data/lib/autoproj/cli/clean.rb +10 -10
  34. data/lib/autoproj/cli/commit.rb +7 -8
  35. data/lib/autoproj/cli/doc.rb +2 -2
  36. data/lib/autoproj/cli/envsh.rb +1 -2
  37. data/lib/autoproj/cli/exec.rb +60 -20
  38. data/lib/autoproj/cli/inspection_tool.rb +13 -7
  39. data/lib/autoproj/cli/locate.rb +30 -41
  40. data/lib/autoproj/cli/log.rb +7 -7
  41. data/lib/autoproj/cli/main.rb +217 -205
  42. data/lib/autoproj/cli/main_doc.rb +22 -21
  43. data/lib/autoproj/cli/main_global.rb +44 -19
  44. data/lib/autoproj/cli/main_plugin.rb +18 -18
  45. data/lib/autoproj/cli/main_test.rb +28 -27
  46. data/lib/autoproj/cli/manifest.rb +7 -7
  47. data/lib/autoproj/cli/osdeps.rb +12 -11
  48. data/lib/autoproj/cli/patcher.rb +2 -3
  49. data/lib/autoproj/cli/query.rb +17 -18
  50. data/lib/autoproj/cli/reconfigure.rb +1 -2
  51. data/lib/autoproj/cli/reset.rb +9 -12
  52. data/lib/autoproj/cli/show.rb +38 -39
  53. data/lib/autoproj/cli/status.rb +56 -44
  54. data/lib/autoproj/cli/switch_config.rb +5 -6
  55. data/lib/autoproj/cli/tag.rb +12 -11
  56. data/lib/autoproj/cli/test.rb +7 -7
  57. data/lib/autoproj/cli/update.rb +97 -43
  58. data/lib/autoproj/cli/utility.rb +14 -12
  59. data/lib/autoproj/cli/version.rb +42 -40
  60. data/lib/autoproj/cli/versions.rb +14 -15
  61. data/lib/autoproj/cli/watch.rb +33 -37
  62. data/lib/autoproj/cli/which.rb +16 -20
  63. data/lib/autoproj/cli.rb +4 -2
  64. data/lib/autoproj/configuration.rb +78 -86
  65. data/lib/autoproj/default.osdeps +29 -3
  66. data/lib/autoproj/environment.rb +42 -23
  67. data/lib/autoproj/exceptions.rb +9 -3
  68. data/lib/autoproj/find_workspace.rb +20 -25
  69. data/lib/autoproj/git_server_configuration.rb +40 -44
  70. data/lib/autoproj/gitorious.rb +1 -1
  71. data/lib/autoproj/installation_manifest.rb +64 -29
  72. data/lib/autoproj/local_package_set.rb +13 -11
  73. data/lib/autoproj/manifest.rb +139 -132
  74. data/lib/autoproj/metapackage.rb +2 -6
  75. data/lib/autoproj/ops/atomic_write.rb +7 -6
  76. data/lib/autoproj/ops/build.rb +4 -6
  77. data/lib/autoproj/ops/cache.rb +41 -43
  78. data/lib/autoproj/ops/cached_env.rb +5 -4
  79. data/lib/autoproj/ops/configuration.rb +519 -507
  80. data/lib/autoproj/ops/import.rb +88 -63
  81. data/lib/autoproj/ops/install.rb +218 -192
  82. data/lib/autoproj/ops/loader.rb +77 -76
  83. data/lib/autoproj/ops/main_config_switcher.rb +36 -45
  84. data/lib/autoproj/ops/phase_reporting.rb +4 -4
  85. data/lib/autoproj/ops/snapshot.rb +250 -247
  86. data/lib/autoproj/ops/tools.rb +76 -78
  87. data/lib/autoproj/ops/watch.rb +6 -6
  88. data/lib/autoproj/ops/which.rb +17 -14
  89. data/lib/autoproj/options.rb +13 -2
  90. data/lib/autoproj/os_package_installer.rb +102 -92
  91. data/lib/autoproj/os_package_query.rb +7 -13
  92. data/lib/autoproj/os_package_resolver.rb +189 -140
  93. data/lib/autoproj/os_repository_installer.rb +4 -4
  94. data/lib/autoproj/os_repository_resolver.rb +8 -6
  95. data/lib/autoproj/package_definition.rb +12 -13
  96. data/lib/autoproj/package_managers/apt_dpkg_manager.rb +19 -11
  97. data/lib/autoproj/package_managers/bundler_manager.rb +186 -129
  98. data/lib/autoproj/package_managers/debian_version.rb +25 -21
  99. data/lib/autoproj/package_managers/emerge_manager.rb +2 -3
  100. data/lib/autoproj/package_managers/gem_manager.rb +68 -77
  101. data/lib/autoproj/package_managers/homebrew_manager.rb +3 -4
  102. data/lib/autoproj/package_managers/manager.rb +8 -3
  103. data/lib/autoproj/package_managers/pacman_manager.rb +2 -3
  104. data/lib/autoproj/package_managers/pip_manager.rb +30 -28
  105. data/lib/autoproj/package_managers/pkg_manager.rb +3 -4
  106. data/lib/autoproj/package_managers/port_manager.rb +2 -3
  107. data/lib/autoproj/package_managers/shell_script_manager.rb +47 -25
  108. data/lib/autoproj/package_managers/unknown_os_manager.rb +5 -8
  109. data/lib/autoproj/package_managers/yum_manager.rb +12 -15
  110. data/lib/autoproj/package_managers/zypper_manager.rb +11 -14
  111. data/lib/autoproj/package_manifest.rb +28 -74
  112. data/lib/autoproj/package_selection.rb +187 -187
  113. data/lib/autoproj/package_set.rb +145 -114
  114. data/lib/autoproj/python.rb +297 -0
  115. data/lib/autoproj/query_base.rb +20 -14
  116. data/lib/autoproj/reporter.rb +19 -19
  117. data/lib/autoproj/repository_managers/apt.rb +102 -68
  118. data/lib/autoproj/repository_managers/unknown_os_manager.rb +3 -3
  119. data/lib/autoproj/ros_condition_parser.rb +84 -0
  120. data/lib/autoproj/ros_package_manifest.rb +125 -0
  121. data/lib/autoproj/shell_completion.rb +16 -13
  122. data/lib/autoproj/source_package_query.rb +29 -36
  123. data/lib/autoproj/system.rb +32 -21
  124. data/lib/autoproj/test.rb +131 -106
  125. data/lib/autoproj/variable_expansion.rb +10 -10
  126. data/lib/autoproj/vcs_definition.rb +53 -37
  127. data/lib/autoproj/version.rb +1 -1
  128. data/lib/autoproj/workspace.rb +143 -108
  129. data/lib/autoproj/zsh_completion.rb +8 -9
  130. data/lib/autoproj.rb +55 -53
  131. data/samples/autoproj/init.rb +1 -2
  132. metadata +86 -65
  133. data/.travis.yml +0 -22
@@ -1,36 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'autoproj/package_managers/manager'
4
- require 'autoproj/package_managers/unknown_os_manager'
5
- require 'autoproj/package_managers/shell_script_manager'
6
-
7
- require 'autoproj/package_managers/apt_dpkg_manager'
8
- require 'autoproj/package_managers/emerge_manager'
9
- require 'autoproj/package_managers/homebrew_manager'
10
- require 'autoproj/package_managers/pacman_manager'
11
- require 'autoproj/package_managers/pkg_manager'
12
- require 'autoproj/package_managers/port_manager'
13
- require 'autoproj/package_managers/yum_manager'
14
- require 'autoproj/package_managers/zypper_manager'
15
-
16
- require 'autoproj/package_managers/bundler_manager'
17
- require 'autoproj/package_managers/pip_manager'
3
+ require "autoproj/package_managers/manager"
4
+ require "autoproj/package_managers/unknown_os_manager"
5
+ require "autoproj/package_managers/shell_script_manager"
6
+
7
+ require "autoproj/package_managers/apt_dpkg_manager"
8
+ require "autoproj/package_managers/emerge_manager"
9
+ require "autoproj/package_managers/homebrew_manager"
10
+ require "autoproj/package_managers/pacman_manager"
11
+ require "autoproj/package_managers/pkg_manager"
12
+ require "autoproj/package_managers/port_manager"
13
+ require "autoproj/package_managers/yum_manager"
14
+ require "autoproj/package_managers/zypper_manager"
15
+
16
+ require "autoproj/package_managers/bundler_manager"
17
+ require "autoproj/package_managers/pip_manager"
18
18
 
19
19
  module Autoproj
20
20
  class OSPackageInstaller
21
21
  attr_reader :ws
22
22
 
23
23
  PACKAGE_MANAGERS = Hash[
24
- 'apt-dpkg' => PackageManagers::AptDpkgManager,
25
- 'gem' => PackageManagers::BundlerManager,
26
- 'emerge' => PackageManagers::EmergeManager,
27
- 'pacman' => PackageManagers::PacmanManager,
28
- 'brew' => PackageManagers::HomebrewManager,
29
- 'yum' => PackageManagers::YumManager,
30
- 'macports' => PackageManagers::PortManager,
31
- 'zypper' => PackageManagers::ZypperManager,
32
- 'pip' => PackageManagers::PipManager ,
33
- 'pkg' => PackageManagers::PkgManager
24
+ "apt-dpkg" => PackageManagers::AptDpkgManager,
25
+ "gem" => PackageManagers::BundlerManager,
26
+ "emerge" => PackageManagers::EmergeManager,
27
+ "pacman" => PackageManagers::PacmanManager,
28
+ "brew" => PackageManagers::HomebrewManager,
29
+ "yum" => PackageManagers::YumManager,
30
+ "macports" => PackageManagers::PortManager,
31
+ "zypper" => PackageManagers::ZypperManager,
32
+ "pip" => PackageManagers::PipManager,
33
+ "pkg" => PackageManagers::PkgManager
34
34
  ]
35
35
 
36
36
  attr_reader :os_package_resolver
@@ -39,6 +39,7 @@ module Autoproj
39
39
  attr_reader :installed_resolved_packages
40
40
 
41
41
  attr_writer :silent
42
+
42
43
  def silent?
43
44
  @silent
44
45
  end
@@ -83,10 +84,10 @@ module Autoproj
83
84
  package_managers.each(&block)
84
85
  end
85
86
 
86
- HANDLE_ALL = 'all'
87
- HANDLE_RUBY = 'ruby'
88
- HANDLE_OS = 'os'
89
- HANDLE_NONE = 'none'
87
+ HANDLE_ALL = "all"
88
+ HANDLE_RUBY = "ruby"
89
+ HANDLE_OS = "os"
90
+ HANDLE_NONE = "none"
90
91
 
91
92
  def osdeps_mode_option_unsupported_os(config)
92
93
  long_doc = <<-EOT
@@ -117,16 +118,16 @@ about the OS packages that you will need to install manually.
117
118
 
118
119
  So, what do you want ? (all, none or a comma-separated list of: gem pip)
119
120
  EOT
120
- message = [ "Which prepackaged software (a.k.a. 'osdeps') should autoproj install automatically (all, none or a comma-separated list of: gem pip) ?", long_doc.strip ]
121
+ message = ["Which prepackaged software (a.k.a. 'osdeps') should autoproj install automatically (all, none or a comma-separated list of: gem pip) ?", long_doc.strip]
121
122
 
122
- config.declare 'osdeps_mode', 'string',
123
- default: 'ruby',
124
- doc: message,
125
- lowercase: true
123
+ config.declare "osdeps_mode", "string",
124
+ default: "ruby",
125
+ doc: message,
126
+ lowercase: true
126
127
  end
127
128
 
128
129
  def osdeps_mode_option_supported_os(config)
129
- long_doc =<<-EOT
130
+ long_doc = <<-EOT
130
131
  The software packages that autoproj will have to build may require other
131
132
  prepackaged softwares (a.k.a. OS dependencies) to be installed (RubyGems
132
133
  packages, packages from your operating system/distribution, ...). Autoproj
@@ -158,10 +159,10 @@ about the OS packages that you will need to install manually.
158
159
 
159
160
  So, what do you want ? (all, none or a comma-separated list of: os gem pip)
160
161
  EOT
161
- message = [ "Which prepackaged software (a.k.a. 'osdeps') should autoproj install automatically (all, none or a comma-separated list of: os gem pip) ?", long_doc.strip ]
162
+ message = ["Which prepackaged software (a.k.a. 'osdeps') should autoproj install automatically (all, none or a comma-separated list of: os gem pip) ?", long_doc.strip]
162
163
 
163
- config.declare 'osdeps_mode', 'string',
164
- default: 'all',
164
+ config.declare "osdeps_mode", "string",
165
+ default: "all",
165
166
  doc: message,
166
167
  lowercase: true
167
168
  end
@@ -175,21 +176,21 @@ So, what do you want ? (all, none or a comma-separated list of: os gem pip)
175
176
  end
176
177
 
177
178
  def osdeps_mode_string_to_value(string)
178
- user_modes = string.to_s.downcase.split(',')
179
+ user_modes = string.to_s.downcase.split(",")
179
180
  modes = []
180
181
  user_modes.each do |str|
181
182
  case str
182
- when 'all' then modes.concat(%w[os gem pip])
183
- when 'ruby' then modes << 'gem'
184
- when 'gem' then modes << 'gem'
185
- when 'pip' then modes << 'pip'
186
- when 'os' then modes << 'os'
187
- when 'none' then
183
+ when "all" then modes.concat(%w[os gem pip])
184
+ when "ruby" then modes << "gem"
185
+ when "gem" then modes << "gem"
186
+ when "pip" then modes << "pip"
187
+ when "os" then modes << "os"
188
+ when "none" then # rubocop:disable Lint/EmptyWhen
188
189
  else
189
190
  if package_managers.key?(str)
190
191
  modes << str
191
192
  else
192
- raise ArgumentError, "#{str} is not a known package handler, known handlers are #{package_managers.keys.sort.join(", ")}"
193
+ raise ArgumentError, "#{str} is not a known package handler, known handlers are #{package_managers.keys.sort.join(', ')}"
193
194
  end
194
195
  end
195
196
  end
@@ -197,7 +198,7 @@ So, what do you want ? (all, none or a comma-separated list of: os gem pip)
197
198
  end
198
199
 
199
200
  def configure_manager
200
- os_package_manager.configure_manager if osdeps_mode.include?('os')
201
+ os_package_manager.configure_manager if osdeps_mode.include?("os")
201
202
  end
202
203
 
203
204
  # If set to true (the default), #install will try to remove the list of
@@ -224,37 +225,38 @@ So, what do you want ? (all, none or a comma-separated list of: os gem pip)
224
225
  # AUTOPROJ_OSDEPS_MODE and/or configuration file. Moreover, it
225
226
  # allows to override the osdeps mode by using
226
227
  # OSPackageInstaller#osdeps_mode=
227
- if @osdeps_mode
228
- return @osdeps_mode
229
- end
228
+ return @osdeps_mode if @osdeps_mode
230
229
 
231
230
  config = ws.config
232
- while true
231
+ loop do
233
232
  mode =
234
- if !config.has_value_for?('osdeps_mode') && mode_name = ENV['AUTOPROJ_OSDEPS_MODE']
233
+ if !config.has_value_for?("osdeps_mode") &&
234
+ (mode_name = ENV["AUTOPROJ_OSDEPS_MODE"])
235
235
  begin osdeps_mode_string_to_value(mode_name)
236
236
  rescue ArgumentError
237
- Autoproj.warn "invalid osdeps mode given through AUTOPROJ_OSDEPS_MODE (#{mode})"
237
+ Autoproj.warn "invalid osdeps mode given through "\
238
+ "AUTOPROJ_OSDEPS_MODE (#{mode})"
238
239
  nil
239
240
  end
240
241
  else
241
- mode_name = config.get('osdeps_mode')
242
+ mode_name = config.get("osdeps_mode")
242
243
  begin osdeps_mode_string_to_value(mode_name)
243
244
  rescue ArgumentError
244
- Autoproj.warn "invalid osdeps mode stored in configuration file"
245
+ Autoproj.warn "invalid osdeps mode stored "\
246
+ "in configuration file"
245
247
  nil
246
248
  end
247
249
  end
248
250
 
249
251
  if mode
250
252
  @osdeps_mode = mode
251
- config.set('osdeps_mode', mode_name, true)
253
+ config.set("osdeps_mode", mode_name, true)
252
254
  return mode
253
255
  end
254
256
 
255
257
  # Invalid configuration values. Retry
256
- config.reset('osdeps_mode')
257
- ENV['AUTOPROJ_OSDEPS_MODE'] = nil
258
+ config.reset("osdeps_mode")
259
+ ENV["AUTOPROJ_OSDEPS_MODE"] = nil
258
260
  end
259
261
  end
260
262
 
@@ -275,27 +277,25 @@ So, what do you want ? (all, none or a comma-separated list of: os gem pip)
275
277
  handler.enabled = false
276
278
  end
277
279
  osdeps_mode.each do |m|
278
- if m == 'os'
280
+ if m == "os"
279
281
  os_package_manager.enabled = true
280
- elsif pkg = package_managers[m]
282
+ elsif (pkg = package_managers[m])
281
283
  pkg.enabled = true
282
284
  else
283
- Autoproj.warn "osdep handler #{m.inspect} found in osdep_mode has no handler, available handlers are #{package_managers.keys.map(&:inspect).sort.join(", ")}"
285
+ available = package_managers.keys.map(&:inspect).sort.join(", ")
286
+ Autoproj.warn "osdep handler #{m.inspect} found in osdep_mode "\
287
+ "has no handler, available handlers are #{available}"
284
288
  end
285
289
  end
286
- os_package_manager.silent = self.silent?
290
+ os_package_manager.silent = silent?
287
291
  package_managers.each_value do |v|
288
- v.silent = self.silent?
292
+ v.silent = silent?
289
293
  end
290
294
 
291
295
  enabled_handlers = []
292
- if os_package_manager.enabled?
293
- enabled_handlers << os_package_manager
294
- end
296
+ enabled_handlers << os_package_manager if os_package_manager.enabled?
295
297
  package_managers.each_value do |v|
296
- if v.enabled?
297
- enabled_handlers << v
298
- end
298
+ enabled_handlers << v if v.enabled?
299
299
  end
300
300
  enabled_handlers
301
301
  end
@@ -310,19 +310,17 @@ So, what do you want ? (all, none or a comma-separated list of: os gem pip)
310
310
  packages = os_package_resolver.resolve_os_packages(packages)
311
311
 
312
312
  packages = packages.map do |handler_name, list|
313
- if manager = package_managers[handler_name]
314
- [manager, list]
315
- else
313
+ unless (manager = package_managers[handler_name])
316
314
  raise ArgumentError, "no package manager called #{handler_name} found"
317
315
  end
316
+
317
+ [manager, list]
318
318
  end
319
319
 
320
320
  _, other_packages =
321
321
  packages.partition { |handler, list| handler == os_package_manager }
322
322
  other_packages.each do |handler, list|
323
- if handler.respond_to?(:pristine)
324
- handler.pristine(list)
325
- end
323
+ handler.pristine(list) if handler.respond_to?(:pristine)
326
324
  end
327
325
  end
328
326
 
@@ -338,11 +336,11 @@ So, what do you want ? (all, none or a comma-separated list of: os gem pip)
338
336
  def resolve_package_managers_in_mapping(mapping)
339
337
  resolved = Hash.new
340
338
  mapping.each do |manager_name, package_list|
341
- if manager = package_managers[manager_name]
342
- resolved[manager] = package_list
343
- else
339
+ unless (manager = package_managers[manager_name])
344
340
  raise ArgumentError, "no package manager called #{handler_name} found"
345
341
  end
342
+
343
+ resolved[manager] = package_list
346
344
  end
347
345
  resolved
348
346
  end
@@ -378,9 +376,10 @@ So, what do you want ? (all, none or a comma-separated list of: os gem pip)
378
376
  # If the manager is strict, we need to bypass it if we did not
379
377
  # get the complete list of osdep packages
380
378
  if manager.strict? && !all_osdep_packages
381
- if !manager_selected.empty?
382
- raise InternalError, "requesting to install the osdeps #{partitioned_packages[manager].to_a.sort.join(", ")} through #{manager_name} but the complete list of osdep packages managed by this manager was not provided. This would break the workspace"
379
+ unless manager_selected.empty?
380
+ raise InternalError, "requesting to install the osdeps #{partitioned_packages[manager].to_a.sort.join(', ')} through #{manager_name} but the complete list of osdep packages managed by this manager was not provided. This would break the workspace"
383
381
  end
382
+
384
383
  next
385
384
  end
386
385
 
@@ -412,29 +411,40 @@ So, what do you want ? (all, none or a comma-separated list of: os gem pip)
412
411
  end
413
412
 
414
413
  partitioned_packages[nested_manager] += deps
415
- partitioned_packages = resolve_managers_dependencies(partitioned_packages) if enable_recursion
416
- end
414
+ if enable_recursion
415
+ partitioned_packages = resolve_managers_dependencies(partitioned_packages)
416
+ end
417
+ end
417
418
  end
418
419
  partitioned_packages
419
420
  end
420
421
 
421
422
  # Requests the installation of the given set of packages
422
- def install(osdep_packages, all: nil, install_only: false, run_package_managers_without_packages: false, **options)
423
+ def install(
424
+ osdep_packages, all: nil, install_only: false,
425
+ run_package_managers_without_packages: false, **options
426
+ )
423
427
  setup_package_managers(**options)
424
428
  partitioned_packages =
425
429
  resolve_and_partition_osdep_packages(osdep_packages, all)
426
430
 
427
431
  # Install OS packages first, as the other package handlers might
428
432
  # depend on OS packages
429
- if os_packages = partitioned_packages.delete(os_package_manager)
430
- install_manager_packages(os_package_manager, os_packages,
431
- install_only: install_only,
432
- run_package_managers_without_packages: run_package_managers_without_packages)
433
+ if (os_packages = partitioned_packages.delete(os_package_manager))
434
+ install_manager_packages(
435
+ os_package_manager, os_packages,
436
+ install_only: install_only,
437
+ run_package_managers_without_packages:
438
+ run_package_managers_without_packages
439
+ )
433
440
  end
434
441
  partitioned_packages.each do |manager, package_list|
435
- install_manager_packages(manager, package_list,
436
- install_only: install_only,
437
- run_package_managers_without_packages: run_package_managers_without_packages)
442
+ install_manager_packages(
443
+ manager, package_list,
444
+ install_only: install_only,
445
+ run_package_managers_without_packages:
446
+ run_package_managers_without_packages
447
+ )
438
448
  end
439
449
  end
440
450
 
@@ -445,10 +455,10 @@ So, what do you want ? (all, none or a comma-separated list of: os gem pip)
445
455
  manager.install(
446
456
  list.to_a,
447
457
  filter_uptodate_packages: filter_uptodate_packages?,
448
- install_only: install_only)
458
+ install_only: install_only
459
+ )
449
460
  installed_resolved_packages[manager].merge(list)
450
461
  end
451
462
  end
452
463
  end
453
464
  end
454
-
@@ -18,10 +18,10 @@ module Autoproj
18
18
  # * package_manager: a regexp that matches the underlying package manager
19
19
  #
20
20
  class OSPackageQuery < QueryBase
21
- ALLOWED_FIELDS = [
22
- 'name',
23
- 'real_package',
24
- 'package_manager'
21
+ ALLOWED_FIELDS = %w[
22
+ name
23
+ real_package
24
+ package_manager
25
25
  ]
26
26
  DEFAULT_FIELDS = {
27
27
  }
@@ -76,17 +76,11 @@ module Autoproj
76
76
  v.send(field_name)
77
77
  end
78
78
 
79
- if pkg_value.include?(value)
80
- return EXACT
81
- end
79
+ return EXACT if pkg_value.include?(value)
82
80
 
83
- if !partial?
84
- return
85
- end
81
+ return unless partial?
86
82
 
87
- if pkg_value.any? { |v| @value_rx === v }
88
- return PARTIAL
89
- end
83
+ PARTIAL if pkg_value.any? { |v| @value_rx === v }
90
84
  end
91
85
 
92
86
  # Parse a single field in a query (i.e. a FIELD[=~]VALUE string)