machinery-tool 1.22.1 → 1.22.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/.git_revision +1 -1
  3. data/NEWS +10 -0
  4. data/bin/machinery +1 -1
  5. data/lib/analyze_changed_config_files_diffs_task.rb +6 -6
  6. data/lib/autoyast.rb +2 -2
  7. data/lib/build_task.rb +10 -7
  8. data/lib/cli.rb +1005 -801
  9. data/lib/compare_task.rb +11 -7
  10. data/lib/comparison.rb +2 -2
  11. data/lib/config_base.rb +1 -1
  12. data/lib/config_task.rb +1 -1
  13. data/lib/containerize_task.rb +3 -3
  14. data/lib/containerized_app.rb +1 -1
  15. data/lib/copy_task.rb +1 -1
  16. data/lib/current_user.rb +1 -1
  17. data/lib/deploy_task.rb +6 -4
  18. data/lib/diff_widget.rb +67 -63
  19. data/lib/docker_system.rb +12 -8
  20. data/lib/dpkg_database.rb +1 -1
  21. data/lib/element_filter.rb +7 -4
  22. data/lib/exceptions.rb +23 -5
  23. data/lib/export_task.rb +1 -1
  24. data/lib/exporter.rb +1 -1
  25. data/lib/file_diff.rb +1 -1
  26. data/lib/file_scope.rb +1 -1
  27. data/lib/file_validator.rb +7 -4
  28. data/lib/filter.rb +97 -93
  29. data/lib/filter_option_parser.rb +2 -2
  30. data/lib/hint.rb +64 -59
  31. data/lib/html.rb +1 -1
  32. data/lib/inspect_task.rb +12 -12
  33. data/lib/inspector.rb +3 -3
  34. data/lib/json_validation_error_cleaner.rb +1 -1
  35. data/lib/json_validator.rb +4 -4
  36. data/lib/kiwi_config.rb +8 -4
  37. data/lib/list_task.rb +10 -9
  38. data/lib/local_system.rb +11 -5
  39. data/lib/logged_cheetah.rb +1 -1
  40. data/lib/man_task.rb +10 -6
  41. data/lib/managed_files_database.rb +1 -1
  42. data/lib/manifest.rb +5 -5
  43. data/lib/migration.rb +16 -10
  44. data/lib/mountpoints.rb +1 -1
  45. data/lib/move_task.rb +1 -1
  46. data/lib/remote_system.rb +7 -7
  47. data/lib/remove_task.rb +1 -1
  48. data/lib/renderer.rb +177 -172
  49. data/lib/rpm.rb +4 -4
  50. data/lib/rpm_database.rb +1 -1
  51. data/lib/scope.rb +2 -2
  52. data/lib/scope_file_access_archive.rb +1 -1
  53. data/lib/scope_file_access_flat.rb +1 -1
  54. data/lib/scope_file_store.rb +1 -1
  55. data/lib/serve_html_task.rb +6 -2
  56. data/lib/server.rb +19 -12
  57. data/lib/show_task.rb +10 -6
  58. data/lib/static_html.rb +1 -1
  59. data/lib/system.rb +10 -10
  60. data/lib/system_description.rb +14 -13
  61. data/lib/system_description_memory_store.rb +1 -1
  62. data/lib/system_description_store.rb +9 -9
  63. data/lib/tarball.rb +8 -2
  64. data/lib/upgrade_format_task.rb +11 -6
  65. data/lib/validate_task.rb +2 -2
  66. data/lib/version.rb +1 -1
  67. data/lib/workload_mapper.rb +2 -2
  68. data/lib/workload_mapper_dsl.rb +1 -1
  69. data/lib/zypper.rb +40 -17
  70. data/machinery-helper/machinery_helper.go +35 -16
  71. data/machinery-helper/version.go +1 -1
  72. data/man/generated/machinery.1.gz +0 -0
  73. data/manual/site/sitemap.xml +24 -24
  74. data/plugins/changed_config_files/changed_config_files_inspector.rb +59 -56
  75. data/plugins/changed_config_files/changed_config_files_model.rb +23 -21
  76. data/plugins/changed_config_files/changed_config_files_renderer.rb +56 -52
  77. data/plugins/changed_managed_files/changed_managed_files_inspector.rb +52 -50
  78. data/plugins/changed_managed_files/changed_managed_files_model.rb +23 -21
  79. data/plugins/changed_managed_files/changed_managed_files_renderer.rb +43 -39
  80. data/plugins/environment/environment_inspector.rb +25 -23
  81. data/plugins/environment/environment_model.rb +5 -3
  82. data/plugins/groups/groups_inspector.rb +30 -28
  83. data/plugins/groups/groups_model.rb +18 -17
  84. data/plugins/groups/groups_renderer.rb +29 -25
  85. data/plugins/os/os_inspector.rb +120 -118
  86. data/plugins/os/os_model.rb +139 -134
  87. data/plugins/os/os_renderer.rb +13 -9
  88. data/plugins/packages/packages_inspector.rb +99 -86
  89. data/plugins/packages/packages_model.rb +35 -34
  90. data/plugins/packages/packages_renderer.rb +47 -39
  91. data/plugins/patterns/patterns_inspector.rb +70 -68
  92. data/plugins/patterns/patterns_model.rb +19 -18
  93. data/plugins/patterns/patterns_renderer.rb +36 -32
  94. data/plugins/repositories/repositories_inspector.rb +162 -156
  95. data/plugins/repositories/repositories_model.rb +50 -49
  96. data/plugins/repositories/repositories_renderer.rb +48 -44
  97. data/plugins/repositories/schema/system-description-repositories.schema-v10.json +0 -1
  98. data/plugins/services/services_inspector.rb +187 -176
  99. data/plugins/services/services_model.rb +37 -36
  100. data/plugins/services/services_renderer.rb +28 -24
  101. data/plugins/unmanaged_files/unmanaged_files_inspector.rb +102 -99
  102. data/plugins/unmanaged_files/unmanaged_files_model.rb +64 -56
  103. data/plugins/unmanaged_files/unmanaged_files_renderer.rb +44 -40
  104. data/plugins/users/users_inspector.rb +67 -65
  105. data/plugins/users/users_model.rb +37 -36
  106. data/plugins/users/users_renderer.rb +31 -27
  107. data/schema/migrations/migrate1to2.rb +1 -1
  108. data/schema/migrations/migrate2to3.rb +1 -1
  109. data/schema/migrations/migrate3to4.rb +1 -1
  110. data/schema/migrations/migrate4to5.rb +1 -1
  111. data/schema/migrations/migrate5to6.rb +1 -1
  112. data/schema/migrations/migrate6to7.rb +1 -1
  113. data/schema/migrations/migrate7to8.rb +1 -1
  114. data/schema/migrations/migrate8to9.rb +1 -1
  115. data/schema/migrations/migrate9to10.rb +1 -1
  116. metadata +2 -2
@@ -15,189 +15,194 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
- class Os < Machinery::Object
19
- include Machinery::Scope
18
+ module Machinery
19
+ class Os < Machinery::Object
20
+ include Machinery::Scope
20
21
 
21
- def self.scope_name
22
- "os"
23
- end
22
+ def self.scope_name
23
+ "os"
24
+ end
24
25
 
25
- def self.descendants
26
- @descendants ||= ObjectSpace.each_object(::Class).select do |klass|
27
- klass < self && klass.descendants.empty?
26
+ def self.descendants
27
+ @descendants ||= ObjectSpace.each_object(::Class).select do |klass|
28
+ klass < self && klass.descendants.empty?
29
+ end
28
30
  end
29
- end
30
31
 
31
- def self.for(os_name)
32
- descendants.each do |os_class|
33
- if os_name == os_class.canonical_name
32
+ def self.for(os_name)
33
+ descendants.each do |os_class|
34
+ next unless os_name == os_class.canonical_name
34
35
  os = os_class.new
35
36
  os.name = os_name
36
37
  return os
37
38
  end
38
- end
39
- if os_name.match(/SUSE Linux|openSUSE/)
40
- os = OsSuse.new
39
+ if os_name =~ /SUSE Linux|openSUSE/
40
+ os = OsSuse.new
41
+ os.name = os_name
42
+ return os
43
+ end
44
+ os = OsUnknown.new
41
45
  os.name = os_name
42
- return os
46
+ os
43
47
  end
44
- os = OsUnknown.new
45
- os.name = os_name
46
- os
47
- end
48
48
 
49
- def self.from_json(json)
50
- scope_object = self.for(json["name"])
51
- scope_object.set_attributes(json)
52
- scope_object
53
- end
49
+ def self.from_json(json)
50
+ scope_object = self.for(json["name"])
51
+ scope_object.set_attributes(json)
52
+ scope_object
53
+ end
54
54
 
55
- def scope_name
56
- "os"
57
- end
55
+ def scope_name
56
+ "os"
57
+ end
58
58
 
59
- def self.module_dependencies
60
- {}
61
- end
59
+ def self.module_dependencies
60
+ {}
61
+ end
62
62
 
63
- def self.can_run_machinery?
64
- true
65
- end
63
+ def self.can_run_machinery?
64
+ true
65
+ end
66
66
 
67
- def self.supported_host_systems
68
- descendants.select { |os| os.can_run_machinery? }
69
- end
67
+ def self.supported_host_systems
68
+ descendants.select(&:can_run_machinery?)
69
+ end
70
70
 
71
- def can_run_machinery?
72
- self.class.can_run_machinery?
73
- end
71
+ def can_run_machinery?
72
+ self.class.can_run_machinery?
73
+ end
74
74
 
75
- def module_required_by_package(package)
76
- self.class.module_dependencies[package]
77
- end
75
+ def module_required_by_package(package)
76
+ self.class.module_dependencies[package]
77
+ end
78
78
 
79
- def canonical_name
80
- self.class.canonical_name
81
- end
79
+ def canonical_name
80
+ self.class.canonical_name
81
+ end
82
82
 
83
- def display_name
84
- "#{name} #{version} (#{architecture})"
83
+ def display_name
84
+ "#{name} #{version} (#{architecture})"
85
+ end
85
86
  end
86
- end
87
87
 
88
- class OsUnknown < Os
89
- def self.canonical_name
90
- "Unknown OS"
88
+ class OsUnknown < Os
89
+ def self.canonical_name
90
+ "Unknown OS"
91
+ end
91
92
  end
92
- end
93
93
 
94
- class OsSuse < Os
95
- def self.canonical_name
96
- "SUSE OS"
97
- end
94
+ class OsSuse < Os
95
+ def self.canonical_name
96
+ "SUSE OS"
97
+ end
98
98
 
99
- def kiwi_bootloader
100
- "grub2"
101
- end
99
+ def kiwi_bootloader
100
+ "grub2"
101
+ end
102
102
 
103
- def kiwi_boot
104
- os_version = version.match(/(\d+)+\.?(\d+)?/)
105
- os_id = case name
106
- when /SUSE Linux Enterprise Server/
107
- "SLES#{os_version[1]}"
108
- when /SUSE Linux Enterprise Desktop/
109
- "SLED#{os_version[1]}"
110
- when /openSUSE/
111
- "#{os_version[1]}.#{os_version[2]}"
112
- end
113
- "vmxboot/suse-#{os_id}"
103
+ def kiwi_boot
104
+ os_version = version.match(/(\d+)+\.?(\d+)?/)
105
+ os_id = case name
106
+ when /SUSE Linux Enterprise Server/
107
+ "SLES#{os_version[1]}"
108
+ when /SUSE Linux Enterprise Desktop/
109
+ "SLED#{os_version[1]}"
110
+ when /openSUSE/
111
+ "#{os_version[1]}.#{os_version[2]}"
112
+ end
113
+ "vmxboot/suse-#{os_id}"
114
+ end
114
115
  end
115
- end
116
116
 
117
- class OsSles11 < OsSuse
118
- def self.canonical_name
119
- "SUSE Linux Enterprise Server 11"
120
- end
117
+ class OsSles11 < OsSuse
118
+ def self.canonical_name
119
+ "SUSE Linux Enterprise Server 11"
120
+ end
121
121
 
122
- def self.can_run_machinery?
123
- false
124
- end
122
+ def self.can_run_machinery?
123
+ false
124
+ end
125
125
 
126
- def display_name
127
- version =~ /11 (.*)/
128
- sp = $1
129
- "#{name} #{sp} (#{architecture})"
130
- end
126
+ def display_name
127
+ version =~ /11 (.*)/
128
+ sp = $1
129
+ "#{name} #{sp} (#{architecture})"
130
+ end
131
131
 
132
- def kiwi_bootloader
133
- "grub"
132
+ def kiwi_bootloader
133
+ "grub"
134
+ end
134
135
  end
135
- end
136
136
 
137
- class OsSles12 < OsSuse
138
- def self.canonical_name
139
- "SUSE Linux Enterprise Server 12"
140
- end
137
+ class OsSles12 < OsSuse
138
+ def self.canonical_name
139
+ "SUSE Linux Enterprise Server 12"
140
+ end
141
141
 
142
- def self.module_dependencies
143
- { "python-glanceclient" => "Public Cloud Module" }
144
- end
142
+ def self.module_dependencies
143
+ { "python-glanceclient" => "Public Cloud Module" }
144
+ end
145
145
 
146
- def display_name
147
- "#{name} (#{architecture})"
146
+ def display_name
147
+ "#{name} (#{architecture})"
148
+ end
148
149
  end
149
- end
150
150
 
151
- class OsOpenSuse < OsSuse
152
- def display_name
153
- name =~ /(.*) \(.*\)/
154
- name_and_version_without_codename = $1
155
- "#{name_and_version_without_codename} (#{architecture})"
151
+ class OsOpenSuse < OsSuse
152
+ def display_name
153
+ name =~ /(.*) \(.*\)/
154
+ name_and_version_without_codename = $1
155
+ "#{name_and_version_without_codename} (#{architecture})"
156
+ end
156
157
  end
157
- end
158
158
 
159
- class OsOpenSuse13_1 < OsOpenSuse
160
- def self.canonical_name
161
- "openSUSE 13.1 (Bottle)"
159
+ # rubocop:disable Style/ClassAndModuleCamelCase
160
+ class OsOpenSuse13_1 < OsOpenSuse
161
+ # rubocop:enable Style/ClassAndModuleCamelCase
162
+ def self.canonical_name
163
+ "openSUSE 13.1 (Bottle)"
164
+ end
162
165
  end
163
- end
164
166
 
165
- class OsOpenSuse13_2 < OsOpenSuse
166
- def self.canonical_name
167
- "openSUSE 13.2 (Harlequin)"
167
+ # rubocop:disable Style/ClassAndModuleCamelCase
168
+ class OsOpenSuse13_2 < OsOpenSuse
169
+ # rubocop:enable Style/ClassAndModuleCamelCase
170
+ def self.canonical_name
171
+ "openSUSE 13.2 (Harlequin)"
172
+ end
168
173
  end
169
- end
170
174
 
171
- class OsOpenSuseTumbleweed < OsSuse
172
- def display_name
173
- "#{name} (#{architecture})"
174
- end
175
+ class OsOpenSuseTumbleweed < OsSuse
176
+ def display_name
177
+ "#{name} (#{architecture})"
178
+ end
175
179
 
176
- def self.canonical_name
177
- "openSUSE Tumbleweed"
178
- end
180
+ def self.canonical_name
181
+ "openSUSE Tumbleweed"
182
+ end
179
183
 
180
- def kiwi_boot
181
- "vmxboot/suse-tumbleweed"
184
+ def kiwi_boot
185
+ "vmxboot/suse-tumbleweed"
186
+ end
182
187
  end
183
- end
184
188
 
185
- class OsOpenSuseLeap < OsSuse
186
- def display_name
187
- "#{name} (#{architecture})"
188
- end
189
+ class OsOpenSuseLeap < OsSuse
190
+ def display_name
191
+ "#{name} (#{architecture})"
192
+ end
189
193
 
190
- def self.canonical_name
191
- "openSUSE Leap"
192
- end
194
+ def self.canonical_name
195
+ "openSUSE Leap"
196
+ end
193
197
 
194
- def kiwi_boot
195
- "vmxboot/suse-leap42.1"
198
+ def kiwi_boot
199
+ "vmxboot/suse-leap42.1"
200
+ end
196
201
  end
197
- end
198
202
 
199
- class Rhel < Os
200
- def self.canonical_name
201
- "Red Hat Enterprise Linux Server"
203
+ class Rhel < Os
204
+ def self.canonical_name
205
+ "Red Hat Enterprise Linux Server"
206
+ end
202
207
  end
203
208
  end
@@ -16,16 +16,20 @@
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
18
  # This renderer prints the operating system
19
- class OsRenderer < Renderer
20
- def content(description)
21
- return unless description.os
19
+ module Machinery
20
+ class Ui
21
+ class OsRenderer < Machinery::Ui::Renderer
22
+ def content(description)
23
+ return unless description.os
22
24
 
23
- puts "Name: #{description.os.name}"
24
- puts "Version: #{description.os.version}"
25
- puts "Architecture: #{description.os.architecture}"
26
- end
25
+ puts "Name: #{description.os.name}"
26
+ puts "Version: #{description.os.version}"
27
+ puts "Architecture: #{description.os.architecture}"
28
+ end
27
29
 
28
- def display_name
29
- "Operating System"
30
+ def display_name
31
+ "Operating System"
32
+ end
33
+ end
30
34
  end
31
35
  end
@@ -15,111 +15,124 @@
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
17
 
18
- class PackagesInspector < Inspector
19
- has_priority 20
20
- def initialize(system, description)
21
- @system = system
22
- @description = description
23
- end
18
+ module Machinery
19
+ class PackagesInspector < Machinery::Inspector
20
+ has_priority 20
21
+ def initialize(system, description)
22
+ @system = system
23
+ @description = description
24
+ end
24
25
 
25
- def inspect(_filter, _options = {})
26
- @system.check_requirement(["rpm", "dpkg"], "--version")
26
+ def inspect(_filter, _options = {})
27
+ @system.check_requirement(["rpm", "dpkg"], "--version")
28
+
29
+ if @system.has_command?("rpm")
30
+ inspect_rpm
31
+ elsif @system.has_command?("dpkg")
32
+ @system.check_requirement("apt-cache", "--version")
33
+ inspect_dpkg
34
+ end
27
35
 
28
- if @system.has_command?("rpm")
29
- inspect_rpm
30
- elsif @system.has_command?("dpkg")
31
- @system.check_requirement("apt-cache", "--version")
32
- inspect_dpkg
36
+ @description
33
37
  end
34
38
 
35
- @description
36
- end
39
+ def summary
40
+ "Found #{Machinery.pluralize(@description.packages.length, "%d package")}."
41
+ end
37
42
 
38
- def summary
39
- "Found #{Machinery.pluralize(@description.packages.length, "%d package")}."
40
- end
43
+ private
41
44
 
42
- private
43
-
44
- def inspect_rpm
45
- packages = Machinery::Array.new
46
- rpm_data = @system.run_command(
47
- "rpm","-qa","--qf",
48
- "%{NAME}|%{VERSION}|%{RELEASE}|%{ARCH}|%{VENDOR}|%{SIGMD5}$",
49
- :stdout=>:capture
50
- )
51
- # gpg-pubkeys are no real packages but listed by rpm in the regular
52
- # package list
53
- rpm_data.scan(/(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\$/).reject do |name, *attrs|
54
- name =~ /^gpg-pubkey$/
55
- end.each do |name, version, release, arch, vendor, checksum|
56
- packages << RpmPackage.new(
57
- :name => name,
58
- :version => version,
59
- :release => release,
60
- :arch => arch,
61
- :vendor => vendor,
62
- :checksum => checksum
45
+ def inspect_rpm
46
+ packages = Machinery::Array.new
47
+ rpm_data = @system.run_command(
48
+ "rpm",
49
+ "-qa",
50
+ "--qf",
51
+ "%{NAME}|%{VERSION}|%{RELEASE}|%{ARCH}|%{VENDOR}|%{SIGMD5}$",
52
+ stdout: :capture
53
+ )
54
+ # gpg-pubkeys are no real packages but listed by rpm in the regular
55
+ # package list
56
+ rpm_data.scan(/(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\|(.*?)\$/).reject do |name, *_attrs|
57
+ name =~ /^gpg-pubkey$/
58
+ end.each do |name, version, release, arch, vendor, checksum|
59
+ packages << RpmPackage.new(
60
+ name: name,
61
+ version: version,
62
+ release: release,
63
+ arch: arch,
64
+ vendor: vendor,
65
+ checksum: checksum
66
+ )
67
+ end
68
+
69
+ @description.packages = PackagesScope.new(
70
+ packages.sort_by(&:name),
71
+ package_system: "rpm"
63
72
  )
64
73
  end
65
74
 
66
- @description.packages = PackagesScope.new(
67
- packages.sort_by(&:name),
68
- package_system: "rpm"
69
- )
70
- end
75
+ def inspect_dpkg
76
+ dpkg_data = @system.run_command(
77
+ "dpkg", "-l", stdout: :capture
78
+ )
71
79
 
72
- def inspect_dpkg
73
- dpkg_data = @system.run_command(
74
- "dpkg", "-l", stdout: :capture
75
- )
80
+ lines = dpkg_data.lines.reject { |line| !line.start_with?("ii ") }
76
81
 
77
- lines = dpkg_data.lines.reject { |line| !line.start_with?("ii ") }
82
+ packages = lines.map do |line|
83
+ name, version, arch = line.split[1..3]
84
+ version_segments = version.split("-")
85
+ release = version_segments.pop if version_segments.length > 1
86
+ version = version_segments.join("-")
78
87
 
79
- packages = lines.map do |line|
80
- name, version, arch = line.split[1..3]
81
- version_segments = version.split("-")
82
- release = version_segments.pop if version_segments.length > 1
83
- version = version_segments.join("-")
88
+ Machinery::DpkgPackage.new(
89
+ name: name,
90
+ version: version,
91
+ release: release,
92
+ arch: arch
93
+ )
94
+ end
95
+ packages.each_slice(100) do |packages_slice|
96
+ apt_cache_output = run_apt_cache(packages_slice)
84
97
 
85
- DpkgPackage.new(
86
- name: name,
87
- version: version,
88
- release: release,
89
- arch: arch
90
- )
98
+ apt_cache_elements = Hash[
99
+ *apt_cache_output.split("\n\n").flat_map do |element|
100
+ name = element[/Package: (.+)$/, 1]
101
+ [name, element]
102
+ end
103
+ ]
104
+
105
+ packages_slice.each do |package|
106
+ name = package.name.sub(/:[^:]+$/, "")
107
+ apt_cache_element = apt_cache_elements[name]
108
+ if apt_cache_element
109
+ package.arch = apt_cache_element[/Architecture: (\w+)\n/, 1]
110
+ checksum = apt_cache_element[/MD5[Ss]um: (\w+)\n/, 1]
111
+ vendor = apt_cache_element[/Origin: (\w+)\n/, 1]
112
+ end
113
+ package.checksum = checksum || ""
114
+ package.vendor = vendor || ""
115
+ package.release ||= ""
116
+ end
117
+
118
+ @description.packages = Machinery::PackagesScope.new(
119
+ packages.sort_by(&:name),
120
+ package_system: "dpkg"
121
+ )
122
+ end
91
123
  end
92
- packages.each_slice(100) do |packages_slice|
93
- apt_cache_output = @system.run_command(
124
+
125
+ def run_apt_cache(packages_slice)
126
+ @system.run_command(
94
127
  "apt-cache",
95
128
  "show",
96
129
  *packages_slice.map { |p| "#{p.name}=#{[p.version, p.release].compact.join("-")}" },
97
130
  stdout: :capture
98
131
  )
99
-
100
- apt_cache_elements = Hash[
101
- *apt_cache_output.split("\n\n").flat_map do |element|
102
- name = element[/Package: (\w+)$/, 1]
103
- [name, element]
104
- end
105
- ]
106
-
107
- packages_slice.each do |package|
108
- name = package.name.sub(/:[^:]+$/, "")
109
- apt_cache_element = apt_cache_elements[name]
110
- if apt_cache_element
111
- checksum = apt_cache_element[/MD5sum: (\w+)\n/, 1]
112
- vendor = apt_cache_element[/Origin: (\w+)\n/, 1]
113
- end
114
- package.checksum = checksum || ""
115
- package.vendor = vendor || ""
116
- package.release ||= ""
117
- end
132
+ rescue Cheetah::ExecutionFailed => e
133
+ # Older Debian systems do not support the version parameter for `apt-cache show`
134
+ raise unless e.stderr.include?("E: No packages found")
135
+ @system.run_command("apt-cache", "show", *packages_slice.map(&:name), stdout: :capture)
118
136
  end
119
-
120
- @description.packages = PackagesScope.new(
121
- packages.sort_by(&:name),
122
- package_system: "dpkg"
123
- )
124
137
  end
125
138
  end