simp-rake-helpers 5.12.3 → 5.12.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 33beb8e656840401f0fb3a07f7aee982fe3931d53b2e233f2e0024398fd03d6c
4
- data.tar.gz: 81111ce62e4e8b3ca03a478d765e3944ee8b297af7b2ee1ef5e182e8bacf36f3
3
+ metadata.gz: d79c389d3f40c038b0ba81fe8351e4f71b256bd1eaeeef52eb0af07239ec793b
4
+ data.tar.gz: 1025900b3bbfa941429f228c7952bf79ccfec9a0b388a5a8fcfaf670b3c6f590
5
5
  SHA512:
6
- metadata.gz: 9589c0d228dc77b2e75a641f158ca878c56498566696039c71eca0c414078299c2a7c4951cf48d45e0388b9cb72a1615321381084a11837fbbc42259a65ea880
7
- data.tar.gz: 4267702fa365999433e673f26ff0896ad9a088ea7ce7ae26fff38bbc4d9c37b1c6239956bc016644ea8b2aa3b10925989f44fbb178a3d611380eb79db4b5cc6e
6
+ metadata.gz: 9c2e9f763a211891553cde62a1963f9fd603f1ce9bfed11b828b36206fe5ec73e1b55f7d1f570c5d1df79cdc00c534d57cc8df24cd205e4cabe946895e820d47
7
+ data.tar.gz: 818c69dcf5bab3bba5516539852abc856973f97275bc186d46ef268c2878d6a4e0542d179a47fd3ed6e48266ff819fc7c70127953694f92b6b7c1b5c03377e98
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 5.12.4 / 2021-10-05
2
+ - Ensure that the DIST qualifier is added to all built RPMs
3
+ - Use the new SimpRepos directory layout when building an ISO using externally
4
+ copied repos.
5
+
1
6
  ### 5.12.3 / 2021-09-15
2
7
  - Handle multiple options for required applications in build:auto
3
8
  - Allow users to populate a `reposync` directory in the YUM build space that
@@ -190,12 +190,19 @@ module Simp::Rake::Build
190
190
  end
191
191
  end
192
192
 
193
+ repo_target_dir = dir
194
+
193
195
  # If we've pulled in reposync directories, we expect them to
194
196
  # completely overwrite the directory of the same name in the
195
197
  # target ISO so no pruning is required
196
198
  #
197
199
  # Note: CASE MATTERS on the directory names
198
200
  if reposync_active
201
+ # We're working with the new EL8+ layout, so we need to target
202
+ # the SimpRepos subdirectory
203
+ repo_target_dir = File.join(dir,'SimpRepos')
204
+ mkdir_p(repo_target_dir, :verbose => verbose)
205
+
199
206
  repos_to_overwrite = Dir.glob(File.join(reposync_location, '*'))
200
207
  .delete_if{|x| !File.directory?(x)}
201
208
  .map{|x| File.basename(x)}
@@ -204,13 +211,18 @@ module Simp::Rake::Build
204
211
  src = File.join(reposync_location, repo)
205
212
  target = File.join(dir, repo)
206
213
 
207
- rm_rf(target, :verbose => verbose) if File.directory?(target)
208
- cp_r(src, dir, :verbose => verbose)
214
+ if File.directory?(target)
215
+ rm_rf(target, :verbose => verbose) if File.directory?(target)
216
+ else
217
+ target = File.join(repo_target_dir, repo)
218
+ end
219
+
220
+ cp_r(src, target, :verbose => verbose)
209
221
  end
210
222
  else
211
223
  # Prune unwanted packages
212
224
  begin
213
- system("tar --no-same-permissions -C #{dir} -xzf #{tball} *simp_pkglist.txt")
225
+ system("tar --no-same-permissions -C #{repo_target_dir} -xzf #{tball} *simp_pkglist.txt")
214
226
  rescue
215
227
  # Does not matter if the command fails
216
228
  end
@@ -235,14 +247,18 @@ module Simp::Rake::Build
235
247
  next if line =~ /^(\s+|#.*)$/
236
248
  exclude_pkgs.push(line.chomp)
237
249
  end
238
- prune_packages(dir,['SIMP'],exclude_pkgs,mkrepo)
250
+ prune_packages(dir,['SIMP','SimpRepos'],exclude_pkgs,mkrepo)
239
251
  end
240
252
  end
241
253
 
242
254
  # Add the SIMP code
243
255
  system("tar --no-same-permissions -C #{dir} -xzf #{tball}")
244
256
 
245
- Dir.chdir("#{dir}/SIMP") do
257
+ # Pop the SIMP directory from the tarball into the correct spot
258
+ # FIXME: This is a hack
259
+ FileUtils.mv("#{dir}/SIMP", repo_target_dir) if File.directory?("#{dir}/SIMP")
260
+
261
+ Dir.chdir("#{repo_target_dir}/SIMP") do
246
262
  # Add the SIMP Dependencies
247
263
  simp_base_ver = simpver.split('-').first
248
264
 
@@ -285,26 +301,40 @@ module Simp::Rake::Build
285
301
  cp(rpm,rpm_arch, :verbose => verbose)
286
302
  end
287
303
 
288
- ln_s('noarch', arch, :verbose => verbose) if (!File.directory?(arch) && File.directory?('noarch'))
289
- fail("Could not find architecture '#{arch}' in the SIMP distribution") unless (File.directory?(arch) || File.symlink?(arch))
304
+ unless reposync_active
305
+ ln_s('noarch', arch, :verbose => verbose) if (!File.directory?(arch) && File.directory?('noarch'))
306
+ fail("Could not find architecture '#{arch}' in the SIMP distribution") unless (File.directory?(arch) || File.symlink?(arch))
290
307
 
291
- # Get everything set up properly...
292
- Dir.chdir(arch) do
293
- Dir.glob('../*') do |rpm_dir|
294
- # Don't dive into ourselves
295
- next if File.basename(rpm_dir) == arch
308
+ # Get everything set up properly...
309
+ Dir.chdir(arch) do
310
+ Dir.glob('../*') do |rpm_dir|
311
+ # Don't dive into ourselves
312
+ next if File.basename(rpm_dir) == arch
296
313
 
297
- Dir.glob(%(#{rpm_dir}/*.rpm)) do |source_rpm|
298
- link_target = File.basename(source_rpm)
299
- if File.exist?(source_rpm) && File.exist?(link_target)
300
- next if Pathname.new(source_rpm).realpath == Pathname.new(link_target).realpath
301
- end
314
+ Dir.glob(%(#{rpm_dir}/*.rpm)) do |source_rpm|
315
+ link_target = File.basename(source_rpm)
316
+ if File.exist?(source_rpm) && File.exist?(link_target)
317
+ next if Pathname.new(source_rpm).realpath == Pathname.new(link_target).realpath
318
+ end
302
319
 
303
- ln_sf(source_rpm,link_target, :verbose => verbose)
320
+ ln_sf(source_rpm,link_target, :verbose => verbose)
321
+ end
304
322
  end
305
323
  end
324
+ end
325
+
326
+ fail("Error: Could not run createrepo in #{Dir.pwd}") unless system(%(#{mkrepo} .))
327
+ end
306
328
 
307
- fail("Error: Could not run createrepo in #{Dir.pwd}") unless system(%(#{mkrepo} .))
329
+ # New ISO Layout
330
+ if reposync_active
331
+ Dir.chdir(repo_target_dir) do
332
+ gpgkeysdir = File.join('SIMP','GPGKEYS')
333
+
334
+ if File.directory?(gpgkeysdir)
335
+ cp_r(gpgkeysdir, '.', :verbose => verbose)
336
+ rm_rf(gpgkeysdir, :verbose => verbose)
337
+ end
308
338
  end
309
339
  end
310
340
 
@@ -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
@@ -2,5 +2,5 @@ module Simp; end
2
2
  module Simp::Rake; end
3
3
 
4
4
  class Simp::Rake::Helpers
5
- VERSION = '5.12.3'
5
+ VERSION = '5.12.4'
6
6
  end
@@ -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
- 'pupmod-simp-testpackage-0.0.1-1.noarch.rpm'
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
- 'pupmod-simp-testpackage-0.0.1-1.noarch.rpm'
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', 'pupmod-simp-testpackage-0.0.1-42.noarch.rpm')
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, 'dist/pupmod-simp-testpackage-0.0.1-1.noarch.rpm') }
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 -i -e \"s/^Passphrase: /Passphrase: OOPS/\" #{key_gen_file}")
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.3
4
+ version: 5.12.4
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-09-28 00:00:00.000000000 Z
12
+ date: 2021-10-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simp-beaker-helpers