simp-rake-helpers 5.12.2 → 5.12.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/lib/simp/rake/build/auto.rb +4 -2
- data/lib/simp/rake/build/build.rb +4 -3
- data/lib/simp/rake/build/iso.rb +148 -43
- data/lib/simp/rake/build/pkg.rb +26 -16
- data/lib/simp/rake/build/tar.rb +7 -1
- data/lib/simp/rake/build/vermap.yaml +1 -1
- data/lib/simp/rake/helpers/assets/rpm_spec/simp6.spec +2 -2
- data/lib/simp/rake/helpers/assets/rpm_spec/simpdefault.spec +2 -2
- data/lib/simp/rake/helpers/version.rb +1 -1
- data/lib/simp/rake/helpers.rb +2 -2
- data/lib/simp/rpm_signer.rb +8 -3
- data/spec/acceptance/suites/default/00_pkg_rpm_custom_scriptlets_spec.rb +3 -2
- data/spec/acceptance/suites/default/10_pkg_rpm_spec.rb +3 -3
- data/spec/acceptance/suites/default/55_build_pkg_signing_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51d1aeb754d81247df05b01fce650e64c4b03fdab941f955e3180e79edcc2964
|
4
|
+
data.tar.gz: e8d8c2ef11a657dfce5bd7755d94f024bd2466fbad243f930f6624bc7e699955
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff5da7ac89c5cf55ae28d69be89992a904e0341c33534e3e301eee6a409d7f801d2df49a2de8dc889e46eb1defb42233c5e707bf8d67c215972998f2a483272a
|
7
|
+
data.tar.gz: 9a3bc2da54cc811be5c3129665124c90761f0c7a962ab54a1c8b11722e506b0691a7d429492e1d30d29930d082af942472dd7984b1bb674d5fe7c0c34928179a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
### 5.12.6 / 2021-10-19
|
2
|
+
- Ensure that the `Updates` directory does not link to files in itself
|
3
|
+
|
4
|
+
### 5.12.5 / 2021-10-07
|
5
|
+
- Fixed a bug where `build:auto` failed when building the SIMP ISO for EL7,
|
6
|
+
because the code attempted to move a directory onto itself.
|
7
|
+
- Ensured GPG keys in simp-gpgkeys are available in the DVD overlay tar file
|
8
|
+
|
9
|
+
### 5.12.4 / 2021-10-05
|
10
|
+
- Ensure that the DIST qualifier is added to all built RPMs
|
11
|
+
- Use the new SimpRepos directory layout when building an ISO using externally
|
12
|
+
copied repos.
|
13
|
+
|
14
|
+
### 5.12.3 / 2021-09-15
|
15
|
+
- Handle multiple options for required applications in build:auto
|
16
|
+
- Allow users to populate a `reposync` directory in the YUM build space that
|
17
|
+
will overwrite any target directories on the ISO.
|
18
|
+
- The SIMP tarball is unpacked after the copy so you always get the latest
|
19
|
+
built artifacts.
|
20
|
+
- Pruning will not occur if this technique is used since it is presumed that
|
21
|
+
you are overwriting the data with authoritative content.
|
22
|
+
- Added a helpful tip about updating vermap.yaml
|
23
|
+
- Fixed the call to repoclosure if on a system with DNF
|
24
|
+
- Added support for EL8 to vermap.yaml
|
25
|
+
|
1
26
|
### 5.12.2 / 2021-06-22
|
2
27
|
- Change to '-1' from '-0' as the default RPM release
|
3
28
|
|
data/lib/simp/rake/build/auto.rb
CHANGED
@@ -18,6 +18,8 @@ module Simp::Rake::Build
|
|
18
18
|
class Auto < ::Rake::TaskLib
|
19
19
|
|
20
20
|
# Commands that are required by some part of the rake stack
|
21
|
+
#
|
22
|
+
# Use an array for commands that may have multiple valid options
|
21
23
|
BUILD_REQUIRED_COMMANDS = [
|
22
24
|
'basename',
|
23
25
|
'cat',
|
@@ -42,7 +44,7 @@ module Simp::Rake::Build
|
|
42
44
|
'make',
|
43
45
|
'mkdir',
|
44
46
|
'mktemp',
|
45
|
-
'python',
|
47
|
+
['python','python2','python3'],
|
46
48
|
'readlink',
|
47
49
|
'repoclosure',
|
48
50
|
'rm',
|
@@ -62,7 +64,7 @@ module Simp::Rake::Build
|
|
62
64
|
'wc',
|
63
65
|
'which',
|
64
66
|
'xargs',
|
65
|
-
'yum',
|
67
|
+
['dnf','yum'],
|
66
68
|
'yumdownloader'
|
67
69
|
]
|
68
70
|
|
@@ -204,7 +204,8 @@ module Simp::Rake::Build
|
|
204
204
|
|
205
205
|
Dir.chdir(target_dir) do
|
206
206
|
if File.exist?('packages.yaml')
|
207
|
-
|
207
|
+
# The empty YAML file returns 'false'
|
208
|
+
known_package_hash = YAML::load_file('packages.yaml') || {}
|
208
209
|
end
|
209
210
|
end
|
210
211
|
|
@@ -276,12 +277,12 @@ module Simp::Rake::Build
|
|
276
277
|
pkg = downloaded_package_hash[pkg][:rpm_name]
|
277
278
|
}.compact
|
278
279
|
|
279
|
-
if known_packages.empty? && downloaded_packages.empty?
|
280
|
+
if known_packages.empty? && downloaded_packages.empty? && Dir.glob('reposync/**/repomd.xml').empty?
|
280
281
|
fail <<-EOM
|
281
282
|
Error: Could not find anything to do!
|
282
283
|
|
283
284
|
In #{target_dir}:
|
284
|
-
No packages in either packages.yaml or the packages/ directory
|
285
|
+
No packages in either packages.yaml or the packages/ directory and no repos found in the reposync/ directory
|
285
286
|
EOM
|
286
287
|
end
|
287
288
|
|
data/lib/simp/rake/build/iso.rb
CHANGED
@@ -120,6 +120,9 @@ module Simp::Rake::Build
|
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
123
|
+
reposync_location = File.join(@build_dir,'yum_data','reposync')
|
124
|
+
reposync_active = !Dir.glob(File.join(reposync_location, '**', 'repomd.xml')).empty?
|
125
|
+
|
123
126
|
tarfiles = File.directory?(tarball) ?
|
124
127
|
Dir.glob("#{tarball}/*.tar.gz") : [tarball]
|
125
128
|
vermap = YAML::load_file( File.join( File.dirname(__FILE__), 'vermap.yaml'))
|
@@ -171,6 +174,7 @@ module Simp::Rake::Build
|
|
171
174
|
unless Array(vermap[simpver.split('.').first]).include?(baseosver.split('.').first)
|
172
175
|
if verbose
|
173
176
|
warn("Could not find SIMP version mapping for #{simpver} for Base OS #{baseosver}")
|
177
|
+
warn("Do you need to update vermap.yaml in the Gem?")
|
174
178
|
end
|
175
179
|
|
176
180
|
next
|
@@ -186,40 +190,83 @@ module Simp::Rake::Build
|
|
186
190
|
end
|
187
191
|
end
|
188
192
|
|
189
|
-
# Prune unwanted packages
|
190
|
-
begin
|
191
|
-
system("tar --no-same-permissions -C #{dir} -xzf #{tball} *simp_pkglist.txt")
|
192
|
-
rescue
|
193
|
-
# Does not matter if the command fails
|
194
|
-
end
|
195
193
|
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
194
|
+
repo_target_dir = dir
|
195
|
+
|
196
|
+
# If we've pulled in reposync directories, we expect them to
|
197
|
+
# completely overwrite the directory of the same name in the
|
198
|
+
# target ISO so no pruning is required
|
199
|
+
#
|
200
|
+
# Note: CASE MATTERS on the directory names
|
201
|
+
if reposync_active
|
202
|
+
# We're working with the new EL8+ layout, so we need to target
|
203
|
+
# the SimpRepos subdirectory
|
204
|
+
repo_target_dir = File.join(dir,'SimpRepos')
|
205
|
+
mkdir_p(repo_target_dir, :verbose => verbose)
|
206
|
+
|
207
|
+
repos_to_overwrite = Dir.glob(File.join(reposync_location, '*'))
|
208
|
+
.delete_if{|x| !File.directory?(x)}
|
209
|
+
.map{|x| File.basename(x)}
|
210
|
+
|
211
|
+
repos_to_overwrite.each do |repo|
|
212
|
+
src = File.join(reposync_location, repo)
|
213
|
+
target = File.join(dir, repo)
|
214
|
+
|
215
|
+
if File.directory?(target)
|
216
|
+
rm_rf(target, :verbose => verbose) if File.directory?(target)
|
217
|
+
else
|
218
|
+
target = File.join(repo_target_dir, repo)
|
219
|
+
end
|
220
|
+
|
221
|
+
cp_r(src, target, :verbose => verbose)
|
222
|
+
end
|
223
|
+
else
|
224
|
+
# Prune unwanted packages
|
225
|
+
begin
|
226
|
+
system("tar --no-same-permissions -C #{repo_target_dir} -xzf #{tball} *simp_pkglist.txt")
|
227
|
+
rescue
|
228
|
+
# Does not matter if the command fails
|
229
|
+
end
|
230
|
+
|
231
|
+
pkglist_file = ENV.fetch(
|
232
|
+
'SIMP_PKGLIST_FILE',
|
233
|
+
File.join(dir,"#{baseosver.split('.').first}-simp_pkglist.txt")
|
234
|
+
)
|
235
|
+
|
236
|
+
puts
|
237
|
+
puts '-'*80
|
238
|
+
puts "### Pruning packages not in file '#{pkglist_file}'"
|
239
|
+
puts
|
240
|
+
puts ' (override this with `SIMP_PKGLIST_FILE=<file>`)'
|
241
|
+
puts
|
242
|
+
puts '-'*80
|
243
|
+
puts
|
244
|
+
|
245
|
+
if (args.prune.casecmp("false") != 0) && File.exist?(pkglist_file)
|
246
|
+
exclude_pkgs = Array.new
|
247
|
+
File.read(pkglist_file).each_line do |line|
|
248
|
+
next if line =~ /^(\s+|#.*)$/
|
249
|
+
exclude_pkgs.push(line.chomp)
|
250
|
+
end
|
251
|
+
prune_packages(dir,['SIMP','SimpRepos'],exclude_pkgs,mkrepo)
|
215
252
|
end
|
216
|
-
prune_packages(dir,['SIMP'],exclude_pkgs,mkrepo)
|
217
253
|
end
|
218
254
|
|
219
255
|
# Add the SIMP code
|
220
256
|
system("tar --no-same-permissions -C #{dir} -xzf #{tball}")
|
221
257
|
|
222
|
-
|
258
|
+
# Pop the SIMP directory from the tarball into the correct spot
|
259
|
+
# FIXME: This is a hack
|
260
|
+
unless dir == repo_target_dir
|
261
|
+
simpdir = File.join(dir,'SIMP')
|
262
|
+
|
263
|
+
if File.directory?(simpdir)
|
264
|
+
cp_r(simpdir, repo_target_dir, :verbose => verbose)
|
265
|
+
rm_rf(simpdir, :verbose => verbose)
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
Dir.chdir("#{repo_target_dir}/SIMP") do
|
223
270
|
# Add the SIMP Dependencies
|
224
271
|
simp_base_ver = simpver.split('-').first
|
225
272
|
|
@@ -230,13 +277,14 @@ module Simp::Rake::Build
|
|
230
277
|
yum_dep_location = File.join(@build_dir,'yum_data',simp_dep_src,'packages')
|
231
278
|
end
|
232
279
|
|
280
|
+
yum_dep_rpms = Dir.glob(File.join(yum_dep_location,'*.rpm'))
|
281
|
+
|
233
282
|
unless File.directory?(yum_dep_location)
|
234
|
-
fail("Could not find dependency directory at #{yum_dep_location}")
|
283
|
+
fail("Could not find dependency directory at #{yum_dep_location}") unless reposync_active
|
235
284
|
end
|
236
285
|
|
237
|
-
yum_dep_rpms = Dir.glob(File.join(yum_dep_location,'*.rpm'))
|
238
286
|
if yum_dep_rpms.empty?
|
239
|
-
fail("Could not find any dependency RPMs at #{yum_dep_location}")
|
287
|
+
fail("Could not find any dependency RPMs at #{yum_dep_location}") unless reposync_active
|
240
288
|
end
|
241
289
|
|
242
290
|
# Add any one-off RPMs that you might want to add to your own build
|
@@ -261,24 +309,81 @@ module Simp::Rake::Build
|
|
261
309
|
cp(rpm,rpm_arch, :verbose => verbose)
|
262
310
|
end
|
263
311
|
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
312
|
+
if reposync_active
|
313
|
+
fail("Error: Could not run createrepo in #{Dir.pwd}") unless system(%(#{mkrepo} .))
|
314
|
+
else
|
315
|
+
ln_sf('noarch', arch, :verbose => verbose) if (!File.directory?(arch) && File.directory?('noarch'))
|
316
|
+
fail("Could not find architecture '#{arch}' in the SIMP distribution") unless (File.directory?(arch) || File.symlink?(arch))
|
317
|
+
|
318
|
+
# Get everything set up properly...
|
319
|
+
Dir.chdir(arch) do
|
320
|
+
Dir.glob('../*') do |rpm_dir|
|
321
|
+
# Don't dive into ourselves
|
322
|
+
next if File.basename(rpm_dir) == arch
|
323
|
+
|
324
|
+
Dir.glob(%(#{rpm_dir}/*.rpm)) do |source_rpm|
|
325
|
+
link_target = File.basename(source_rpm)
|
326
|
+
if File.exist?(source_rpm) && File.exist?(link_target)
|
327
|
+
next if Pathname.new(source_rpm).realpath == Pathname.new(link_target).realpath
|
328
|
+
end
|
329
|
+
|
330
|
+
ln_sf(source_rpm,link_target, :verbose => verbose)
|
275
331
|
end
|
332
|
+
end
|
333
|
+
|
334
|
+
fail("Error: Could not run createrepo in #{Dir.pwd}") unless system(%(#{mkrepo} .))
|
335
|
+
end
|
336
|
+
end
|
337
|
+
end
|
338
|
+
|
339
|
+
### Munge the Repos
|
340
|
+
|
341
|
+
# Create an Updates directory that is properly populated
|
342
|
+
updates_readme = <<~README
|
343
|
+
This directory houses updates to NON-MODULAR RPMs.
|
344
|
+
|
345
|
+
DO NOT put modular RPMs in this directory or you will break your
|
346
|
+
system updates!
|
347
|
+
README
|
276
348
|
|
277
|
-
|
349
|
+
updates_dir = File.join(dir, 'Updates')
|
350
|
+
mkdir_p(updates_dir)
|
351
|
+
|
352
|
+
Dir.chdir(updates_dir) do
|
353
|
+
File.open('README','w'){|fh| fh.puts(updates_readme) }
|
354
|
+
|
355
|
+
repos = Dir.glob(File.join('..','**','repodata'))
|
356
|
+
modular_repos = Dir.glob(File.join('..','**','repodata','*-modules.*'))
|
357
|
+
non_modular_repos = repos.select{|x| modular_repos.grep(%r{^#{Regexp.escape(x)}}).empty? }
|
358
|
+
non_modular_repos.map!{|x| File.split(x).first}
|
359
|
+
non_modular_repos.delete_if{|x| x.match(%r{/SimpRepos|/SIMP}) }
|
360
|
+
non_modular_repos.each do |non_modular_repo|
|
361
|
+
Dir.glob(File.join(non_modular_repo, '**', '*.rpm')).each do |rpm|
|
362
|
+
# when non_modular_repo is '..', can still find RPMs we need
|
363
|
+
# to exclude
|
364
|
+
next if rpm.match(%r{/SimpRepos|/SIMP})
|
365
|
+
|
366
|
+
rpm_dest = File.basename(rpm)
|
367
|
+
if File.exist?(rpm) && File.exist?(rpm_dest)
|
368
|
+
next if (File.realpath(rpm) == File.realpath(rpm_dest))
|
278
369
|
end
|
370
|
+
|
371
|
+
ln_sf(rpm, rpm_dest, :verbose => verbose)
|
279
372
|
end
|
373
|
+
end
|
280
374
|
|
281
|
-
|
375
|
+
fail("Error: Could not run createrepo in #{Dir.pwd}") unless system(%(#{mkrepo} .))
|
376
|
+
end
|
377
|
+
|
378
|
+
# New ISO Layout
|
379
|
+
if reposync_active
|
380
|
+
Dir.chdir(repo_target_dir) do
|
381
|
+
gpgkeysdir = File.join('SIMP','GPGKEYS')
|
382
|
+
|
383
|
+
if File.directory?(gpgkeysdir)
|
384
|
+
cp_r(gpgkeysdir, '.', :verbose => verbose)
|
385
|
+
rm_rf(gpgkeysdir, :verbose => verbose)
|
386
|
+
end
|
282
387
|
end
|
283
388
|
end
|
284
389
|
|
data/lib/simp/rake/build/pkg.rb
CHANGED
@@ -606,23 +606,19 @@ protect=1
|
|
606
606
|
mkdir_p('repos/lookaside')
|
607
607
|
mkdir_p('repodata')
|
608
608
|
|
609
|
-
Dir.glob(args[:target_dir]
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
end
|
615
|
-
end
|
609
|
+
Dir.glob(File.join(args[:target_dir], '**', '*.rpm'))
|
610
|
+
.delete_if{|x| x =~ /\.src\.rpm$/}
|
611
|
+
.each do |path|
|
612
|
+
sym_path = "repos/base/#{File.basename(path)}"
|
613
|
+
ln_sf(path,sym_path, :verbose => @verbose) unless File.exists?(sym_path)
|
616
614
|
end
|
617
615
|
|
618
616
|
if args[:aux_dir]
|
619
|
-
Dir.glob(args[:aux_dir]
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
end
|
625
|
-
end
|
617
|
+
Dir.glob(File.join(args[:aux_dir], '**', '*.rpm'))
|
618
|
+
.delete_if{|x| x =~ /\.src\.rpm$/}
|
619
|
+
.each do |path|
|
620
|
+
sym_path = "repos/lookaside/#{File.basename(path)}"
|
621
|
+
ln_sf(path,sym_path, :verbose => @verbose) unless File.exists?(sym_path)
|
626
622
|
end
|
627
623
|
end
|
628
624
|
|
@@ -647,7 +643,12 @@ protect=1
|
|
647
643
|
file.write(ERB.new(yum_conf_template,nil,'-').result(binding))
|
648
644
|
end
|
649
645
|
|
650
|
-
|
646
|
+
dnf_system = which('dnf')
|
647
|
+
if dnf_system
|
648
|
+
cmd = 'repoclosure -c base.conf --disablerepo=* --enablerepo=base'
|
649
|
+
else
|
650
|
+
cmd = 'repoclosure -c repodata -n -t -r base -l lookaside -c yum.conf'
|
651
|
+
end
|
651
652
|
|
652
653
|
if ENV['SIMP_BUILD_verbose'] == 'yes'
|
653
654
|
puts
|
@@ -661,7 +662,16 @@ protect=1
|
|
661
662
|
if (!$?.success? || (repoclosure_output =~ /nresolved/))
|
662
663
|
errmsg = ['Error: REPOCLOSURE FAILED:']
|
663
664
|
errmsg << [repoclosure_output]
|
664
|
-
|
665
|
+
puts(errmsg.join("\n"))
|
666
|
+
|
667
|
+
if dnf_system
|
668
|
+
if ENV.fetch('SIMP_BUILD_prompt', 'yes') != 'no'
|
669
|
+
puts('- Press any key to continue or ^C to abort -')
|
670
|
+
$stdin.gets
|
671
|
+
end
|
672
|
+
else
|
673
|
+
fail('Repoclosure Failed')
|
674
|
+
end
|
665
675
|
end
|
666
676
|
end
|
667
677
|
end
|
data/lib/simp/rake/build/tar.rb
CHANGED
@@ -126,10 +126,16 @@ module Simp::Rake::Build
|
|
126
126
|
|
127
127
|
Simp::RPM.copy_wo_vcs(@dvd_src,".",base_dir)
|
128
128
|
|
129
|
-
# Copy in the GPG Public Keys
|
129
|
+
# Copy in the GPG Public Keys from @build_dir
|
130
130
|
mkdir_p("#{destdir}/GPGKEYS")
|
131
131
|
ln(Dir.glob("#{@build_dir}/GPGKEYS/RPM-GPG-KEY*"), "#{destdir}/GPGKEYS", { :force => true })
|
132
132
|
|
133
|
+
# Copy in the GPG Public Keys packaged by simp-gpgkeys
|
134
|
+
simp_gpgkeys = File.join(@src_dir, 'assets', 'gpgkeys', 'GPGKEYS')
|
135
|
+
if Dir.exist?(simp_gpgkeys)
|
136
|
+
ln(Dir.glob("#{simp_gpgkeys}/RPM-GPG-KEY*"), "#{destdir}/GPGKEYS", { :force => true })
|
137
|
+
end
|
138
|
+
|
133
139
|
# Copy in the auto-build RPMs
|
134
140
|
Dir.chdir("#{@build_dir}/SIMP/RPMS") do
|
135
141
|
Dir.glob('*').each do |type|
|
@@ -301,7 +301,7 @@ end
|
|
301
301
|
|
302
302
|
if req_file then
|
303
303
|
for line in req_file:lines() do
|
304
|
-
valid_line = (line:match("^Requires: ") or line:match("^Obsoletes: ") or line:match("^Provides: "))
|
304
|
+
valid_line = (line:match("^Requires: ") or line:match("^Obsoletes: ") or line:match("^Provides: ") or line:match("^Recommends: "))
|
305
305
|
|
306
306
|
if valid_line then
|
307
307
|
module_requires = (module_requires .. "\n" .. line)
|
@@ -319,7 +319,7 @@ Summary: %{module_name} Puppet Module
|
|
319
319
|
Name: %{package_name}
|
320
320
|
|
321
321
|
Version: %{lua: print(package_version)}
|
322
|
-
Release: %{lua: print(package_release)}
|
322
|
+
Release: %{lua: print(package_release)}%{?dist}
|
323
323
|
License: %{lua: print(module_license)}
|
324
324
|
Group: Applications/System
|
325
325
|
Source0: %{package_name}-%{version}-%{release}.tar.gz
|
@@ -301,7 +301,7 @@ end
|
|
301
301
|
|
302
302
|
if req_file then
|
303
303
|
for line in req_file:lines() do
|
304
|
-
valid_line = (line:match("^Requires: ") or line:match("^Obsoletes: ") or line:match("^Provides: "))
|
304
|
+
valid_line = (line:match("^Requires: ") or line:match("^Obsoletes: ") or line:match("^Provides: ") or line:match("^Recommends: "))
|
305
305
|
|
306
306
|
if valid_line then
|
307
307
|
module_requires = (module_requires .. "\n" .. line)
|
@@ -319,7 +319,7 @@ Summary: %{module_name} Puppet Module
|
|
319
319
|
Name: %{package_name}
|
320
320
|
|
321
321
|
Version: %{lua: print(package_version)}
|
322
|
-
Release: %{lua: print(package_release)}
|
322
|
+
Release: %{lua: print(package_release)}%{?dist}
|
323
323
|
License: %{lua: print(module_license)}
|
324
324
|
Group: Applications/System
|
325
325
|
Source0: %{package_name}-%{version}-%{release}.tar.gz
|
data/lib/simp/rake/helpers.rb
CHANGED
@@ -20,8 +20,8 @@ class Simp::Rake::Helpers
|
|
20
20
|
invalid_commands = Array.new
|
21
21
|
|
22
22
|
Array(required_commands).each do |command|
|
23
|
-
unless Facter::Core::Execution.which(
|
24
|
-
invalid_commands << command
|
23
|
+
unless Array(command).find { |x| Facter::Core::Execution.which(x) }
|
24
|
+
invalid_commands << Array(command).join(' or ')
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
data/lib/simp/rpm_signer.rb
CHANGED
@@ -195,8 +195,13 @@ class Simp::RpmSigner
|
|
195
195
|
# the first RPM to be signed with the key after the gpg-agent is
|
196
196
|
# started and the key's passphrase has not been cleared from the
|
197
197
|
# agent's cache.
|
198
|
-
read.expect(/pass\s?phrase
|
199
|
-
|
198
|
+
read.expect(/(pass\s?phrase:|verwrite).*/) do |text|
|
199
|
+
if text.last.include?('verwrite')
|
200
|
+
write.puts('y')
|
201
|
+
else
|
202
|
+
write.puts(gpgkey[:password])
|
203
|
+
end
|
204
|
+
|
200
205
|
write.flush
|
201
206
|
end
|
202
207
|
end
|
@@ -287,7 +292,7 @@ class Simp::RpmSigner
|
|
287
292
|
begin
|
288
293
|
results = Parallel.map(
|
289
294
|
to_sign,
|
290
|
-
:in_processes =>
|
295
|
+
:in_processes => 1,
|
291
296
|
:progress => opts[:progress_bar_title]
|
292
297
|
) do |rpm|
|
293
298
|
_result = nil
|
@@ -11,7 +11,7 @@ shared_examples_for 'an RPM generator with customized scriptlets' do
|
|
11
11
|
scriptlets = rpm_scriptlets_for(
|
12
12
|
host,
|
13
13
|
"#{pkg_root_dir}/testpackage_custom_scriptlet/dist/" +
|
14
|
-
|
14
|
+
"pupmod-simp-testpackage-0.0.1-1#{rpm_dist}.noarch.rpm"
|
15
15
|
)
|
16
16
|
|
17
17
|
comment '...the expected scriptlet types are present'
|
@@ -69,7 +69,7 @@ shared_examples_for 'an RPM generator with customized triggers' do
|
|
69
69
|
triggers = rpm_triggers_for(
|
70
70
|
host,
|
71
71
|
"#{pkg_root_dir}/testpackage_custom_scriptlet/dist/" +
|
72
|
-
|
72
|
+
"pupmod-simp-testpackage-0.0.1-1#{rpm_dist}.noarch.rpm"
|
73
73
|
)
|
74
74
|
|
75
75
|
|
@@ -107,6 +107,7 @@ describe 'rake pkg:rpm with customized content' do
|
|
107
107
|
hosts.each do |_host|
|
108
108
|
context "on #{_host}" do
|
109
109
|
let!(:host){ _host }
|
110
|
+
let(:rpm_dist){ on(host, %{rpm --eval '%{dist}'}).output.strip.gsub(/\.centos$/, '') }
|
110
111
|
|
111
112
|
it 'can prep the package directories' do
|
112
113
|
testpackages = [
|
@@ -10,7 +10,7 @@ shared_examples_for 'an RPM generator with edge cases' do
|
|
10
10
|
it 'should use specified release number for the RPM' do
|
11
11
|
on host, %(#{run_cmd} "cd #{pkg_root_dir}/testpackage_with_release; #{rake_cmd} pkg:rpm")
|
12
12
|
release_test_rpm = File.join(pkg_root_dir, 'testpackage_with_release',
|
13
|
-
'dist',
|
13
|
+
'dist', "pupmod-simp-testpackage-0.0.1-42#{rpm_dist}.noarch.rpm")
|
14
14
|
on host, %(test -f #{release_test_rpm})
|
15
15
|
end
|
16
16
|
|
@@ -73,10 +73,10 @@ describe 'rake pkg:rpm' do
|
|
73
73
|
copy_host_files_into_build_user_homedir(hosts)
|
74
74
|
end
|
75
75
|
|
76
|
-
|
77
76
|
hosts.each do |_host|
|
78
77
|
context "on #{_host}" do
|
79
78
|
let!(:host){ _host }
|
79
|
+
let(:rpm_dist){ on(host, %{rpm --eval '%{dist}'}).output.strip.gsub(/\.centos$/, '') }
|
80
80
|
|
81
81
|
context 'rpm building' do
|
82
82
|
|
@@ -107,7 +107,7 @@ describe 'rake pkg:rpm' do
|
|
107
107
|
context 'using simpdefault.spec' do
|
108
108
|
|
109
109
|
let(:build_type) {:default}
|
110
|
-
let(:testpackage_rpm) { File.join(testpackage_dir,
|
110
|
+
let(:testpackage_rpm) { File.join(testpackage_dir, "dist/pupmod-simp-testpackage-0.0.1-1#{rpm_dist}.noarch.rpm") }
|
111
111
|
|
112
112
|
it 'should create an RPM' do
|
113
113
|
comment "produces RPM on #{host}"
|
@@ -320,7 +320,7 @@ describe 'rake pkg:signrpms and pkg:checksig' do
|
|
320
320
|
|
321
321
|
it 'should corrupt the password of new key' do
|
322
322
|
key_gen_file = File.join(dev_keydir, 'gengpgkey')
|
323
|
-
on(hosts, "sed -
|
323
|
+
on(hosts, "sed -ci -e \"s/^Passphrase: /Passphrase: OOPS/\" #{key_gen_file}")
|
324
324
|
end
|
325
325
|
|
326
326
|
include_examples('it begins with unsigned RPMs')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simp-rake-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.12.
|
4
|
+
version: 5.12.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Tessmer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-10-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: simp-beaker-helpers
|