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,36 +1,36 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
|
7
|
-
require
|
8
|
-
require
|
9
|
-
require
|
10
|
-
require
|
11
|
-
require
|
12
|
-
require
|
13
|
-
require
|
14
|
-
require
|
15
|
-
|
16
|
-
require
|
17
|
-
require
|
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
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
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 =
|
87
|
-
HANDLE_RUBY =
|
88
|
-
HANDLE_OS =
|
89
|
-
HANDLE_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 = [
|
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
|
123
|
-
|
124
|
-
|
125
|
-
|
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
|
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 = [
|
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
|
164
|
-
default:
|
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
|
183
|
-
when
|
184
|
-
when
|
185
|
-
when
|
186
|
-
when
|
187
|
-
when
|
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?(
|
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
|
-
|
231
|
+
loop do
|
233
232
|
mode =
|
234
|
-
if !config.has_value_for?(
|
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
|
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(
|
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
|
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(
|
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(
|
257
|
-
ENV[
|
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 ==
|
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
|
-
|
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 =
|
290
|
+
os_package_manager.silent = silent?
|
287
291
|
package_managers.each_value do |v|
|
288
|
-
v.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
|
-
|
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
|
-
|
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
|
-
|
382
|
-
raise InternalError, "requesting to install the osdeps #{partitioned_packages[manager].to_a.sort.join(
|
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
|
-
|
416
|
-
|
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(
|
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(
|
431
|
-
|
432
|
-
|
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(
|
436
|
-
|
437
|
-
|
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
|
-
|
23
|
-
|
24
|
-
|
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
|
-
|
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)
|