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.
- checksums.yaml +4 -4
- data/.git_revision +1 -1
- data/NEWS +10 -0
- data/bin/machinery +1 -1
- data/lib/analyze_changed_config_files_diffs_task.rb +6 -6
- data/lib/autoyast.rb +2 -2
- data/lib/build_task.rb +10 -7
- data/lib/cli.rb +1005 -801
- data/lib/compare_task.rb +11 -7
- data/lib/comparison.rb +2 -2
- data/lib/config_base.rb +1 -1
- data/lib/config_task.rb +1 -1
- data/lib/containerize_task.rb +3 -3
- data/lib/containerized_app.rb +1 -1
- data/lib/copy_task.rb +1 -1
- data/lib/current_user.rb +1 -1
- data/lib/deploy_task.rb +6 -4
- data/lib/diff_widget.rb +67 -63
- data/lib/docker_system.rb +12 -8
- data/lib/dpkg_database.rb +1 -1
- data/lib/element_filter.rb +7 -4
- data/lib/exceptions.rb +23 -5
- data/lib/export_task.rb +1 -1
- data/lib/exporter.rb +1 -1
- data/lib/file_diff.rb +1 -1
- data/lib/file_scope.rb +1 -1
- data/lib/file_validator.rb +7 -4
- data/lib/filter.rb +97 -93
- data/lib/filter_option_parser.rb +2 -2
- data/lib/hint.rb +64 -59
- data/lib/html.rb +1 -1
- data/lib/inspect_task.rb +12 -12
- data/lib/inspector.rb +3 -3
- data/lib/json_validation_error_cleaner.rb +1 -1
- data/lib/json_validator.rb +4 -4
- data/lib/kiwi_config.rb +8 -4
- data/lib/list_task.rb +10 -9
- data/lib/local_system.rb +11 -5
- data/lib/logged_cheetah.rb +1 -1
- data/lib/man_task.rb +10 -6
- data/lib/managed_files_database.rb +1 -1
- data/lib/manifest.rb +5 -5
- data/lib/migration.rb +16 -10
- data/lib/mountpoints.rb +1 -1
- data/lib/move_task.rb +1 -1
- data/lib/remote_system.rb +7 -7
- data/lib/remove_task.rb +1 -1
- data/lib/renderer.rb +177 -172
- data/lib/rpm.rb +4 -4
- data/lib/rpm_database.rb +1 -1
- data/lib/scope.rb +2 -2
- data/lib/scope_file_access_archive.rb +1 -1
- data/lib/scope_file_access_flat.rb +1 -1
- data/lib/scope_file_store.rb +1 -1
- data/lib/serve_html_task.rb +6 -2
- data/lib/server.rb +19 -12
- data/lib/show_task.rb +10 -6
- data/lib/static_html.rb +1 -1
- data/lib/system.rb +10 -10
- data/lib/system_description.rb +14 -13
- data/lib/system_description_memory_store.rb +1 -1
- data/lib/system_description_store.rb +9 -9
- data/lib/tarball.rb +8 -2
- data/lib/upgrade_format_task.rb +11 -6
- data/lib/validate_task.rb +2 -2
- data/lib/version.rb +1 -1
- data/lib/workload_mapper.rb +2 -2
- data/lib/workload_mapper_dsl.rb +1 -1
- data/lib/zypper.rb +40 -17
- data/machinery-helper/machinery_helper.go +35 -16
- data/machinery-helper/version.go +1 -1
- data/man/generated/machinery.1.gz +0 -0
- data/manual/site/sitemap.xml +24 -24
- data/plugins/changed_config_files/changed_config_files_inspector.rb +59 -56
- data/plugins/changed_config_files/changed_config_files_model.rb +23 -21
- data/plugins/changed_config_files/changed_config_files_renderer.rb +56 -52
- data/plugins/changed_managed_files/changed_managed_files_inspector.rb +52 -50
- data/plugins/changed_managed_files/changed_managed_files_model.rb +23 -21
- data/plugins/changed_managed_files/changed_managed_files_renderer.rb +43 -39
- data/plugins/environment/environment_inspector.rb +25 -23
- data/plugins/environment/environment_model.rb +5 -3
- data/plugins/groups/groups_inspector.rb +30 -28
- data/plugins/groups/groups_model.rb +18 -17
- data/plugins/groups/groups_renderer.rb +29 -25
- data/plugins/os/os_inspector.rb +120 -118
- data/plugins/os/os_model.rb +139 -134
- data/plugins/os/os_renderer.rb +13 -9
- data/plugins/packages/packages_inspector.rb +99 -86
- data/plugins/packages/packages_model.rb +35 -34
- data/plugins/packages/packages_renderer.rb +47 -39
- data/plugins/patterns/patterns_inspector.rb +70 -68
- data/plugins/patterns/patterns_model.rb +19 -18
- data/plugins/patterns/patterns_renderer.rb +36 -32
- data/plugins/repositories/repositories_inspector.rb +162 -156
- data/plugins/repositories/repositories_model.rb +50 -49
- data/plugins/repositories/repositories_renderer.rb +48 -44
- data/plugins/repositories/schema/system-description-repositories.schema-v10.json +0 -1
- data/plugins/services/services_inspector.rb +187 -176
- data/plugins/services/services_model.rb +37 -36
- data/plugins/services/services_renderer.rb +28 -24
- data/plugins/unmanaged_files/unmanaged_files_inspector.rb +102 -99
- data/plugins/unmanaged_files/unmanaged_files_model.rb +64 -56
- data/plugins/unmanaged_files/unmanaged_files_renderer.rb +44 -40
- data/plugins/users/users_inspector.rb +67 -65
- data/plugins/users/users_model.rb +37 -36
- data/plugins/users/users_renderer.rb +31 -27
- data/schema/migrations/migrate1to2.rb +1 -1
- data/schema/migrations/migrate2to3.rb +1 -1
- data/schema/migrations/migrate3to4.rb +1 -1
- data/schema/migrations/migrate4to5.rb +1 -1
- data/schema/migrations/migrate5to6.rb +1 -1
- data/schema/migrations/migrate6to7.rb +1 -1
- data/schema/migrations/migrate7to8.rb +1 -1
- data/schema/migrations/migrate8to9.rb +1 -1
- data/schema/migrations/migrate9to10.rb +1 -1
- metadata +2 -2
data/plugins/os/os_model.rb
CHANGED
@@ -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
|
-
|
19
|
-
|
18
|
+
module Machinery
|
19
|
+
class Os < Machinery::Object
|
20
|
+
include Machinery::Scope
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
def self.scope_name
|
23
|
+
"os"
|
24
|
+
end
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
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
|
-
|
32
|
-
|
33
|
-
|
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
|
-
|
39
|
-
|
40
|
-
|
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
|
-
|
46
|
+
os
|
43
47
|
end
|
44
|
-
os = OsUnknown.new
|
45
|
-
os.name = os_name
|
46
|
-
os
|
47
|
-
end
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
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
|
-
|
56
|
-
|
57
|
-
|
55
|
+
def scope_name
|
56
|
+
"os"
|
57
|
+
end
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
59
|
+
def self.module_dependencies
|
60
|
+
{}
|
61
|
+
end
|
62
62
|
|
63
|
-
|
64
|
-
|
65
|
-
|
63
|
+
def self.can_run_machinery?
|
64
|
+
true
|
65
|
+
end
|
66
66
|
|
67
|
-
|
68
|
-
|
69
|
-
|
67
|
+
def self.supported_host_systems
|
68
|
+
descendants.select(&:can_run_machinery?)
|
69
|
+
end
|
70
70
|
|
71
|
-
|
72
|
-
|
73
|
-
|
71
|
+
def can_run_machinery?
|
72
|
+
self.class.can_run_machinery?
|
73
|
+
end
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
|
75
|
+
def module_required_by_package(package)
|
76
|
+
self.class.module_dependencies[package]
|
77
|
+
end
|
78
78
|
|
79
|
-
|
80
|
-
|
81
|
-
|
79
|
+
def canonical_name
|
80
|
+
self.class.canonical_name
|
81
|
+
end
|
82
82
|
|
83
|
-
|
84
|
-
|
83
|
+
def display_name
|
84
|
+
"#{name} #{version} (#{architecture})"
|
85
|
+
end
|
85
86
|
end
|
86
|
-
end
|
87
87
|
|
88
|
-
class OsUnknown < Os
|
89
|
-
|
90
|
-
|
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
|
-
|
96
|
-
|
97
|
-
|
94
|
+
class OsSuse < Os
|
95
|
+
def self.canonical_name
|
96
|
+
"SUSE OS"
|
97
|
+
end
|
98
98
|
|
99
|
-
|
100
|
-
|
101
|
-
|
99
|
+
def kiwi_bootloader
|
100
|
+
"grub2"
|
101
|
+
end
|
102
102
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
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
|
-
|
119
|
-
|
120
|
-
|
117
|
+
class OsSles11 < OsSuse
|
118
|
+
def self.canonical_name
|
119
|
+
"SUSE Linux Enterprise Server 11"
|
120
|
+
end
|
121
121
|
|
122
|
-
|
123
|
-
|
124
|
-
|
122
|
+
def self.can_run_machinery?
|
123
|
+
false
|
124
|
+
end
|
125
125
|
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
126
|
+
def display_name
|
127
|
+
version =~ /11 (.*)/
|
128
|
+
sp = $1
|
129
|
+
"#{name} #{sp} (#{architecture})"
|
130
|
+
end
|
131
131
|
|
132
|
-
|
133
|
-
|
132
|
+
def kiwi_bootloader
|
133
|
+
"grub"
|
134
|
+
end
|
134
135
|
end
|
135
|
-
end
|
136
136
|
|
137
|
-
class OsSles12 < OsSuse
|
138
|
-
|
139
|
-
|
140
|
-
|
137
|
+
class OsSles12 < OsSuse
|
138
|
+
def self.canonical_name
|
139
|
+
"SUSE Linux Enterprise Server 12"
|
140
|
+
end
|
141
141
|
|
142
|
-
|
143
|
-
|
144
|
-
|
142
|
+
def self.module_dependencies
|
143
|
+
{ "python-glanceclient" => "Public Cloud Module" }
|
144
|
+
end
|
145
145
|
|
146
|
-
|
147
|
-
|
146
|
+
def display_name
|
147
|
+
"#{name} (#{architecture})"
|
148
|
+
end
|
148
149
|
end
|
149
|
-
end
|
150
150
|
|
151
|
-
class OsOpenSuse < OsSuse
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
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
|
-
|
160
|
-
|
161
|
-
|
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
|
-
|
166
|
-
|
167
|
-
|
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
|
-
|
173
|
-
|
174
|
-
|
175
|
+
class OsOpenSuseTumbleweed < OsSuse
|
176
|
+
def display_name
|
177
|
+
"#{name} (#{architecture})"
|
178
|
+
end
|
175
179
|
|
176
|
-
|
177
|
-
|
178
|
-
|
180
|
+
def self.canonical_name
|
181
|
+
"openSUSE Tumbleweed"
|
182
|
+
end
|
179
183
|
|
180
|
-
|
181
|
-
|
184
|
+
def kiwi_boot
|
185
|
+
"vmxboot/suse-tumbleweed"
|
186
|
+
end
|
182
187
|
end
|
183
|
-
end
|
184
188
|
|
185
|
-
class OsOpenSuseLeap < OsSuse
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
+
class OsOpenSuseLeap < OsSuse
|
190
|
+
def display_name
|
191
|
+
"#{name} (#{architecture})"
|
192
|
+
end
|
189
193
|
|
190
|
-
|
191
|
-
|
192
|
-
|
194
|
+
def self.canonical_name
|
195
|
+
"openSUSE Leap"
|
196
|
+
end
|
193
197
|
|
194
|
-
|
195
|
-
|
198
|
+
def kiwi_boot
|
199
|
+
"vmxboot/suse-leap42.1"
|
200
|
+
end
|
196
201
|
end
|
197
|
-
end
|
198
202
|
|
199
|
-
class Rhel < Os
|
200
|
-
|
201
|
-
|
203
|
+
class Rhel < Os
|
204
|
+
def self.canonical_name
|
205
|
+
"Red Hat Enterprise Linux Server"
|
206
|
+
end
|
202
207
|
end
|
203
208
|
end
|
data/plugins/os/os_renderer.rb
CHANGED
@@ -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
|
-
|
20
|
-
|
21
|
-
|
19
|
+
module Machinery
|
20
|
+
class Ui
|
21
|
+
class OsRenderer < Machinery::Ui::Renderer
|
22
|
+
def content(description)
|
23
|
+
return unless description.os
|
22
24
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
25
|
+
puts "Name: #{description.os.name}"
|
26
|
+
puts "Version: #{description.os.version}"
|
27
|
+
puts "Architecture: #{description.os.architecture}"
|
28
|
+
end
|
27
29
|
|
28
|
-
|
29
|
-
|
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
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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
|
-
|
26
|
-
|
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
|
-
|
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
|
-
|
36
|
-
|
39
|
+
def summary
|
40
|
+
"Found #{Machinery.pluralize(@description.packages.length, "%d package")}."
|
41
|
+
end
|
37
42
|
|
38
|
-
|
39
|
-
"Found #{Machinery.pluralize(@description.packages.length, "%d package")}."
|
40
|
-
end
|
43
|
+
private
|
41
44
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
end
|
75
|
+
def inspect_dpkg
|
76
|
+
dpkg_data = @system.run_command(
|
77
|
+
"dpkg", "-l", stdout: :capture
|
78
|
+
)
|
71
79
|
|
72
|
-
|
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
|
-
|
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
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
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
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
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
|
-
|
93
|
-
|
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
|
-
|
101
|
-
|
102
|
-
|
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
|