simp-rake-helpers 5.12.6 → 5.12.7

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: 51d1aeb754d81247df05b01fce650e64c4b03fdab941f955e3180e79edcc2964
4
- data.tar.gz: e8d8c2ef11a657dfce5bd7755d94f024bd2466fbad243f930f6624bc7e699955
3
+ metadata.gz: 97111c5cebe9473b33a3ea7950af3cb1b26a48a67d46485435473bad9660cc46
4
+ data.tar.gz: b5e86d3cfad3b1a21300fef1ae99c81f38c87a7c41ce6304e9ceb2e48c1e6f5e
5
5
  SHA512:
6
- metadata.gz: ff5da7ac89c5cf55ae28d69be89992a904e0341c33534e3e301eee6a409d7f801d2df49a2de8dc889e46eb1defb42233c5e707bf8d67c215972998f2a483272a
7
- data.tar.gz: 9a3bc2da54cc811be5c3129665124c90761f0c7a962ab54a1c8b11722e506b0691a7d429492e1d30d29930d082af942472dd7984b1bb674d5fe7c0c34928179a
6
+ metadata.gz: eb8f742f59d39f13a22b79781a69c0ac2855bd8a57e1928e8cc8426d958b6f2724a53e9182cd7bc4139a808308cdeb668334fc707661f6a4576601a5ccbae191
7
+ data.tar.gz: 8b1e9f3584bec5a5c29397802d3c8048ea9552148934f230c15c0bdd226ca763c3a97801c8e98abdc45110bdc6527be68ba504ccd7e0c34c984322bb6b11c6a9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ### 5.12.7 / 2021-10-26
2
+ - Added:
3
+ - Env var `SIMP_PKG_progress_bar=no` to turn off pkg RPM build progress bars
4
+ - Env var `SIMP_PKG_fetch_published_rpm=no` to prevent downloading a
5
+ published package
6
+ - Fixed:
7
+ - RPM builds no longer fail with leftover generated
8
+ `build/rpm_metadata/releases` files
9
+ - Removed unused code, tidied up some confusing bits to make structure more
10
+ obvious
11
+
1
12
  ### 5.12.6 / 2021-10-19
2
13
  - Ensure that the `Updates` directory does not link to files in itself
3
14
 
@@ -21,13 +21,17 @@ module Simp::Rake::Build
21
21
  @rpm_build_metadata = 'last_rpm_build_metadata.yaml'
22
22
  @rpm_dependency_file = File.join(@base_dir, 'build', 'rpm', 'dependencies.yaml')
23
23
  @build_keys_dir = ENV.fetch('SIMP_PKG_build_keys_dir', File.join(@base_dir, '.dev_gpgkeys'))
24
- @long_gpg_socket_err_msg = <<~EOM
24
+ @long_gpg_socket_err_msg = <<~MSG
25
25
  If the problem is 'socket name <xxx> is too long', use SIMP_PKG_build_keys_dir
26
26
  to override
27
27
  #{@build_keys_dir}
28
28
  with a shorter path. The socket name must be < 108 characters.
29
29
 
30
- EOM
30
+ MSG
31
+ # nil = default not set; use local preference
32
+ @fetch_published_rpm_default = ENV['SIMP_PKG_fetch_published_rpm'] ? (
33
+ ENV['SIMP_PKG_fetch_published_rpm'] =~ /\A(yes|true)\Z/i ? true : false
34
+ ) : nil
31
35
 
32
36
  define_tasks
33
37
  end
@@ -114,7 +118,7 @@ module Simp::Rake::Build
114
118
  end
115
119
  end
116
120
 
117
- desc <<-EOM
121
+ desc <<~DESC
118
122
  Prepare a GPG signing key to sign build packages
119
123
 
120
124
  * :key - the name of the build keys subdirectory to prepare
@@ -142,7 +146,7 @@ module Simp::Rake::Build
142
146
  ENV vars:
143
147
  - Set `SIMP_PKG_verbose=yes` to report file operations as they happen.
144
148
  - Set `SIMP_PKG_build_keys_dir` to override the default build keys path.
145
- EOM
149
+ DESC
146
150
  task :key_prep,[:key] => [:prep] do |t,args|
147
151
  args.with_defaults(:key => 'dev')
148
152
  key = args.key
@@ -251,7 +255,7 @@ module Simp::Rake::Build
251
255
 
252
256
 
253
257
  =begin
254
- desc <<-EOM
258
+ desc <<~DESC
255
259
  Build the entire SIMP release.
256
260
 
257
261
  * :docs - Build the docs. Set this to false if you wish to skip building the docs.
@@ -261,7 +265,7 @@ module Simp::Rake::Build
261
265
  - Set `SIMP_PKG_verbose=yes` to report file operations as they happen.
262
266
  - Set `SIMP_YUM_makecache=no` if you do NOT want to rebuild the
263
267
  build-specific YUM cache
264
- EOM
268
+ DESC
265
269
  =end
266
270
  task :build,[:docs,:key] => [:prep,:key_prep] do |t,args|
267
271
  args.with_defaults(:key => 'dev')
@@ -269,12 +273,7 @@ module Simp::Rake::Build
269
273
 
270
274
  check_dvd_env
271
275
 
272
- begin
273
- yum_helper = Simp::YUM.new(
274
- Simp::YUM.generate_yum_conf(File.join(@distro_build_dir, 'yum_data')),
275
- ENV.fetch('SIMP_YUM_makecache','yes') == 'yes')
276
- rescue Simp::YUM::Error
277
- end
276
+ get_yum_helper
278
277
 
279
278
  Rake::Task['pkg:aux'].invoke
280
279
  if "#{args.docs}" == 'true'
@@ -287,7 +286,7 @@ module Simp::Rake::Build
287
286
  Rake::Task['pkg:signrpms'].invoke(args[:key])
288
287
  end
289
288
 
290
- desc <<-EOM
289
+ desc <<~DESC
291
290
  Build the Puppet module RPMs.
292
291
 
293
292
  * :method - The Puppetfile from which the repository information
@@ -295,12 +294,12 @@ module Simp::Rake::Build
295
294
 
296
295
  ENV vars:
297
296
  - Set `SIMP_PKG_verbose=yes` to report file operations as they happen.
298
- EOM
297
+ DESC
299
298
  task :modules,[:method] => [:prep] do |t,args|
300
299
  build(@build_dirs[:modules],t)
301
300
  end
302
301
 
303
- desc <<-EOM
302
+ desc <<~DESC
304
303
  Build a single Puppet Module RPM.
305
304
 
306
305
  * :name - The path, or name, of the module to build. If a name is
@@ -314,11 +313,12 @@ module Simp::Rake::Build
314
313
  - Set `SIMP_PKG_verbose=yes` to report file operations as they happen.
315
314
  - Set `SIMP_YUM_makecache=no` if you do NOT want to rebuild the
316
315
  build-specific YUM cache
317
- EOM
316
+ DESC
318
317
  task :single,[:name,:method] => [:prep] do |t,args|
319
318
  fail("You must pass :name to '#{t.name}'") unless args[:name]
320
319
 
321
320
  mod_path = File.absolute_path(args[:name])
321
+ get_yum_helper
322
322
 
323
323
  if args[:name].include?('/')
324
324
  fail("'#{args[:name]}' does not exist!") unless File.directory?(mod_path)
@@ -333,35 +333,27 @@ module Simp::Rake::Build
333
333
  mod_path = local_module[:path]
334
334
  end
335
335
 
336
- begin
337
- yum_helper = Simp::YUM.new(
338
- Simp::YUM.generate_yum_conf(File.join(@distro_build_dir, 'yum_data')),
339
- ENV.fetch('SIMP_YUM_makecache','yes') == 'yes')
340
- rescue Simp::YUM::Error
341
- end
342
-
343
- ENV['SIMP_PKG_rand_name'] = 'yes'
344
336
  build(Array(mod_path), t)
345
337
 
346
338
  puts("Your packages can be found in '#{mod_path}/dist'")
347
339
  end
348
340
 
349
- desc <<-EOM
341
+ desc <<~DESC
350
342
  Build the SIMP non-module RPMs.
351
343
 
352
344
  ENV vars:
353
345
  - Set `SIMP_PKG_verbose=yes` to report file operations as they happen.
354
- EOM
346
+ DESC
355
347
  task :aux => [:prep] do |t,args|
356
348
  build(@build_dirs[:aux],t)
357
349
  end
358
350
 
359
- desc <<-EOM
351
+ desc <<~DESC
360
352
  Build the SIMP documentation.
361
353
 
362
354
  ENV vars:
363
355
  - Set `SIMP_PKG_verbose=yes` to report file operations as they happen.
364
- EOM
356
+ DESC
365
357
  task :doc => [:prep] do |t,args|
366
358
  # Need to make sure that the docs have the version updated
367
359
  # appropriately prior to building
@@ -373,7 +365,7 @@ module Simp::Rake::Build
373
365
  build(@build_dirs[:doc],t)
374
366
  end
375
367
 
376
- desc <<-EOM
368
+ desc <<~DESC
377
369
  Sign a set of RPMs.
378
370
 
379
371
  Signs any unsigned RPMs in the specified directory
@@ -394,7 +386,7 @@ module Simp::Rake::Build
394
386
  * Set `SIMP_PKG_rpmsign_timeout` to override the maximum time in seconds
395
387
  to wait for an individual RPM signing operation to complete.
396
388
  - Defaults to 60 seconds.
397
- EOM
389
+ DESC
398
390
  task :signrpms,[:key,:rpm_dir,:force,:digest_algo] => [:prep,:key_prep] do |t,args|
399
391
  require 'simp/rpm_signer'
400
392
 
@@ -455,13 +447,13 @@ module Simp::Rake::Build
455
447
  end
456
448
 
457
449
  =begin
458
- desc <<-EOM
450
+ desc <<~DESC
459
451
  Check that RPMs are signed.
460
452
 
461
453
  Checks all RPM files in a directory to see if they are trusted.
462
454
  * :rpm_dir - A directory containing RPM files to check. Default #{@build_dir}/SIMP
463
455
  * :key_dir - The path to the GPG keys you want to check the packages against. Default #{@src_dir}/assets/gpgkeys/
464
- EOM
456
+ DESC
465
457
  =end
466
458
  task :checksig,[:rpm_dir,:key_dir] => [:prep] do |t,args|
467
459
  begin
@@ -547,7 +539,7 @@ module Simp::Rake::Build
547
539
  end
548
540
  end
549
541
 
550
- desc <<-EOM
542
+ desc <<~DESC
551
543
  Run repoclosure on RPM files.
552
544
 
553
545
  Finds all rpm files in the target dir and all of its subdirectories, then
@@ -561,7 +553,7 @@ module Simp::Rake::Build
561
553
  - Set `SIMP_PKG_verbose=yes` to report file operations as they happen.
562
554
  - Set `SIMP_PKG_repoclose_pe=yes` to enable repoclosure on PE-related RPMs.
563
555
 
564
- EOM
556
+ DESC
565
557
  task :repoclosure,[:target_dir,:aux_dir] => [:prep] do |t,args|
566
558
  default_target = @pkg_dirs[:simp]
567
559
  args.with_defaults(:target_dir => File.expand_path(default_target))
@@ -572,31 +564,31 @@ module Simp::Rake::Build
572
564
 
573
565
  _repoclose_pe = ENV.fetch('SIMP_PKG_repoclose_pe','no') == 'yes'
574
566
 
575
- yum_conf_template = <<-EOF
576
- [main]
577
- keepcache=0
578
- exactarch=1
579
- obsoletes=1
580
- gpgcheck=0
581
- plugins=1
582
- installonly_limit=5
583
- <% unless #{_repoclose_pe} -%>
584
- exclude=*-pe-*
585
- <% end -%>
586
-
587
- <% repo_files.each do |repo| -%>
588
- include=file://<%= repo %>
589
- <% end -%>
590
- EOF
591
-
592
- yum_repo_template = <<-EOF
593
- [<%= repo_name %>]
594
- name=<%= repo_name %>
595
- baseurl=file://<%= repo_path %>
596
- enabled=1
597
- gpgcheck=0
598
- protect=1
599
- EOF
567
+ yum_conf_template = <<~YUM_CONF
568
+ [main]
569
+ keepcache=0
570
+ exactarch=1
571
+ obsoletes=1
572
+ gpgcheck=0
573
+ plugins=1
574
+ installonly_limit=5
575
+ <% unless #{_repoclose_pe} -%>
576
+ exclude=*-pe-*
577
+ <% end -%>
578
+
579
+ <% repo_files.each do |repo| -%>
580
+ include=file://<%= repo %>
581
+ <% end -%>
582
+ YUM_CONF
583
+
584
+ yum_repo_template = <<~YUM_REPO
585
+ [<%= repo_name %>]
586
+ name=<%= repo_name %>
587
+ baseurl=file://<%= repo_path %>
588
+ enabled=1
589
+ gpgcheck=0
590
+ protect=1
591
+ YUM_REPO
600
592
 
601
593
  fail("#{args[:target_dir]} does not exist!") unless File.directory?(args[:target_dir])
602
594
 
@@ -677,9 +669,9 @@ protect=1
677
669
  end
678
670
  end
679
671
 
680
- desc <<-EOM
672
+ desc <<~DESC
681
673
  Print published status of all project RPMs
682
- EOM
674
+ DESC
683
675
  task :check_published => [:prep] do |t,args|
684
676
  begin
685
677
  yum_helper = Simp::YUM.new(
@@ -697,7 +689,12 @@ protect=1
697
689
 
698
690
  if Dir.exist?(dir)
699
691
  begin
700
- require_rebuild?(dir, yum_helper, { :verbose => true, :check_git => true, :prefix => '' })
692
+ require_rebuild?(dir, yum_helper, {
693
+ fetch: false,
694
+ verbose: true,
695
+ check_git: true,
696
+ prefix: ''
697
+ })
701
698
  rescue => e
702
699
  _errmsg = "Error: require_rebuild?(): Status check failed on '#{dir}' => #{e}"
703
700
  end
@@ -724,9 +721,24 @@ protect=1
724
721
  return (0...24).map{ (65 + rand(26)).chr }.join.downcase
725
722
  end
726
723
 
724
+ # Return a SIMP::YUM object configured for the local build dir or nil
725
+ #
726
+ # ENV vars:
727
+ # - Set `SIMP_PKG_verbose=yes` to report file operations as they happen.
728
+ # - Set `SIMP_YUM_makecache=no` if you do NOT want to rebuild the
729
+ # build-specific YUM cache
730
+ def get_yum_helper( makecache = (ENV.fetch('SIMP_YUM_makecache','yes') == 'yes') )
731
+ begin
732
+ build_yum_data = File.join(@distro_build_dir, 'yum_data')
733
+ return Simp::YUM.new(Simp::YUM.generate_yum_conf(build_yum_data), makecache)
734
+ rescue Simp::YUM::Error => e
735
+ $stderr.puts "Simp::YUM::Error: #{e}" if @verbose
736
+ end
737
+ end
738
+
727
739
  # Check and see if 'dir' requires a rebuild based on published packages
728
740
  #
729
- # If 'fetch' is true => Download the RPM
741
+ # If 'fetch' is true => Download the published RPM
730
742
  # If 'verbose' is true => Print helpful information to stderr
731
743
  # If 'check_git' is true => Print the git tag status if 'verbose' is true
732
744
  # 'prefix' is used to prepend verbose messages
@@ -735,7 +747,13 @@ protect=1
735
747
  # - Method is too long
736
748
  # - Method needs to be passed in class variables (@xxx) so that it
737
749
  # can be pulled out into a library that is easily unit-testable
738
- def require_rebuild?(dir, yum_helper, opts={ :unique_namespace => generate_namespace, :fetch => false, :verbose => @verbose, :check_git => false, :prefix => '' })
750
+ def require_rebuild?(dir, yum_helper, opts={
751
+ unique_namespace: generate_namespace,
752
+ fetch: false,
753
+ verbose: @verbose,
754
+ check_git: false,
755
+ prefix: ''
756
+ })
739
757
  result = false
740
758
  rpm_metadata = File.exist?(@rpm_dependency_file) ? YAML.load(File.read(@rpm_dependency_file)) : {}
741
759
  dir_relpath = Pathname.new(dir).relative_path_from(Pathname.new(Dir.pwd)).to_path
@@ -870,7 +888,8 @@ protect=1
870
888
  else
871
889
  $stderr.puts "#{opts[:prefix]}Found Existing Remote RPM: #{published_rpm}" if opts[:verbose]
872
890
  if opts[:fetch]
873
- # Download remote RPM, unless already downloaded it.
891
+ # Download published RPM, unless it's already been downloaded.
892
+ # TODO Unhandled edge case: Validate that downloaded RPM is valid
874
893
  if File.exist?(File.join('dist', published_rpm))
875
894
  $stderr.puts "#{opts[:prefix]}#{published_rpm} previously downloaded" if opts[:verbose]
876
895
  else
@@ -914,101 +933,107 @@ protect=1
914
933
  return result
915
934
  end
916
935
 
936
+ def build_pupmod_rpm(dir, yum_helper, dbg_prefix = ' ')
937
+ unique_namespace = generate_namespace
938
+ if require_rebuild?(dir, yum_helper, {
939
+ unique_namespace: unique_namespace,
940
+ fetch: @fetch_published_rpm.nil? ? true : @fetch_published_rpm,
941
+ verbose: @verbose,
942
+ prefix: dbg_prefix,
943
+ })
944
+ $stderr.puts("#{dbg_prefix}Running 'rake pkg:rpm' on #{File.basename(dir)}") if @verbose
945
+ Rake::Task["#{unique_namespace}:pkg:rpm"].invoke
946
+ else
947
+ # Record metadata for the downloaded RPM
948
+ Simp::RPM::create_rpm_build_metadata(File.expand_path(dir))
949
+ end
950
+ true
951
+ end
952
+
953
+
954
+ def build_rakefile_rpm(dir, yum_helper, dbg_prefix = ' ')
955
+ if require_rebuild?(dir, yum_helper, {
956
+ fetch: @fetch_published_rpm.nil? ? true : @fetch_published_rpm,
957
+ verbose: @verbose,
958
+ prefix: dbg_prefix
959
+ })
960
+ $stderr.puts("#{dbg_prefix}Running 'rake pkg:rpm' in #{File.basename(dir)}") if @verbose
961
+ rake_flags = Rake.application.options.trace ? '--trace' : ''
962
+ cmd = %{SIMP_BUILD_version=#{@simp_version} rake pkg:rpm #{rake_flags} 2>&1}
963
+
964
+ build_success = true
965
+ begin
966
+ %x{#{cmd}}
967
+ build_success = $?.success?
968
+
969
+ built_rpm = true
970
+ rescue
971
+ build_success = false
972
+ end
973
+
974
+ unless build_success
975
+ if @verbose
976
+ $stderr.puts("First 'rake pkg:rpm' attempt for #{dir} failed, running bundle and trying again.")
977
+ end
978
+
979
+ if Bundler.respond_to?(:with_unbundled_env)
980
+ # Bundler 2.1+
981
+ clean_env_method = :with_unbundled_env
982
+ bundle_install_cmd = %{bundle config set with 'development' && bundle install}
983
+ else
984
+ # Old Bundler
985
+ clean_env_method = :with_clean_env
986
+ bundle_install_cmd = %{bundle install --with development}
987
+ end
988
+
989
+ ::Bundler.send(clean_env_method) do
990
+ %x{#{bundle_install_cmd}}
991
+
992
+ output = %x{#{cmd} 2>&1}
993
+
994
+ unless $?.success?
995
+ raise("Error in #{dir} running #{cmd}\n#{output}")
996
+ end
997
+ end
998
+ end
999
+ else
1000
+ # Record metadata for the downloaded RPM
1001
+ Simp::RPM::create_rpm_build_metadata(File.expand_path(dir))
1002
+ built_rpm = true
1003
+ end
1004
+ end
1005
+
1006
+
917
1007
  # Takes a list of directories to hop into and perform builds within
918
1008
  #
919
1009
  # The task must be passed so that we can output the calling name in the
920
1010
  # status bar.
921
1011
  def build(dirs, task, rebuild_for_arch=false, remake_yum_cache = false)
922
- _verbose = ENV.fetch('SIMP_PKG_verbose','no') == 'yes'
923
- dbg_prefix = ' ' # prefix for debug messages
924
-
925
1012
  fail("Could not find RPM dependency file '#{@rpm_dependency_file}'") unless File.exist?(@rpm_dependency_file)
926
-
927
- begin
928
- yum_helper = Simp::YUM.new(
929
- Simp::YUM.generate_yum_conf(File.join(@distro_build_dir, 'yum_data'))
930
- )
931
- rescue Simp::YUM::Error
932
- end
1013
+ yum_helper = get_yum_helper( remake_yum_cache )
933
1014
 
934
1015
  Parallel.map(
935
1016
  # Allow for shell globs
936
- Array(dirs),
937
- :in_processes => @cpu_limit,
938
- :progress => task.name
1017
+ Array(dirs), {
1018
+ in_processes: @cpu_limit,
1019
+ progress: (ENV.fetch('SIMP_PKG_progress_bar','yes') == 'yes') ? task.name : nil,
1020
+ }
939
1021
  ) do |dir|
940
1022
  fail("Could not find directory #{dir}") unless Dir.exist?(dir)
941
1023
 
942
1024
  Dir.chdir(dir) do
943
1025
  built_rpm = false
1026
+ $stderr.puts("\nPackaging #{File.basename(dir)}") if @verbose
944
1027
 
945
- if @verbose
946
- $stderr.puts("\nPackaging #{File.basename(dir)}")
947
- end
948
-
949
- # We're building a module, override anything down there
950
1028
  if File.exist?('metadata.json')
951
- unique_namespace = generate_namespace
952
- if require_rebuild?(dir, yum_helper, { :unique_namespace => unique_namespace, :fetch => true, :verbose => @verbose, :prefix => dbg_prefix})
953
- $stderr.puts("#{dbg_prefix}Running 'rake pkg:rpm' on #{File.basename(dir)}") if @verbose
954
- Rake::Task["#{unique_namespace}:pkg:rpm"].invoke
955
- else
956
- # Record metadata for the downloaded RPM
957
- Simp::RPM::create_rpm_build_metadata(File.expand_path(dir))
958
- end
959
-
960
- built_rpm = true
961
-
962
- # We're building one of the extra assets and should honor its Rakefile
963
- # and RPM spec file.
1029
+ # We're building a module, override anything down there
1030
+ built_rpm = build_pupmod_rpm(dir, yum_helper)
964
1031
  elsif File.exist?('Rakefile')
965
- if require_rebuild?(dir, yum_helper, { :fetch => true, :verbose => @verbose, :prefix => dbg_prefix })
966
- $stderr.puts("#{dbg_prefix}Running 'rake pkg:rpm' in #{File.basename(dir)}") if @verbose
967
- rake_flags = Rake.application.options.trace ? '--trace' : ''
968
- cmd = %{SIMP_BUILD_version=#{@simp_version} rake pkg:rpm #{rake_flags} 2>&1}
969
-
970
- build_success = true
971
- begin
972
- %x{#{cmd}}
973
- build_success = $?.success?
974
-
975
- built_rpm = true
976
- rescue
977
- build_success = false
978
- end
979
-
980
- unless build_success
981
- if @verbose
982
- $stderr.puts("First 'rake pkg:rpm' attempt for #{dir} failed, running bundle and trying again.")
983
- end
984
-
985
- if Bundler.respond_to?(:with_unbundled_env)
986
- # Bundler 2.1+
987
- clean_env_method = :with_unbundled_env
988
- bundle_install_cmd = %{bundle config set with 'development' && bundle install}
989
- else
990
- # Old Bundler
991
- clean_env_method = :with_clean_env
992
- bundle_install_cmd = %{bundle install --with development}
993
- end
994
-
995
- ::Bundler.send(clean_env_method) do
996
- %x{#{bundle_install_cmd}}
997
-
998
- output = %x{#{cmd} 2>&1}
999
-
1000
- unless $?.success?
1001
- raise("Error in #{dir} running #{cmd}\n#{output}")
1002
- end
1003
- end
1004
- end
1005
- else
1006
- # Record metadata for the downloaded RPM
1007
- Simp::RPM::create_rpm_build_metadata(File.expand_path(dir))
1008
- built_rpm = true
1009
- end
1032
+ # We're building one of the extra assets and should honor its Rakefile
1033
+ # and RPM spec file.
1034
+ built_rpm = build_rakefile_rpm(dir, yum_helper)
1010
1035
  else
1011
- puts "Warning: '#{dir}' could not be built via Rake"
1036
+ puts "Warning: '#{dir}' could not be built (not a pupmod & no Rakefile!)"
1012
1037
  end
1013
1038
 
1014
1039
  if built_rpm
@@ -1024,12 +1049,7 @@ protect=1
1024
1049
 
1025
1050
  raise("No RPMs generated for #{dir}") if rpms.empty?
1026
1051
  end
1027
-
1028
- if @verbose
1029
- rpms = Dir.glob('dist/*.rpm')
1030
- # $stderr.puts("#{dbg_prefix}RPMS: #{rpms.join("\n#{dbg_prefix} ")}")
1031
- $stderr.puts("Finished #{File.basename(dir)}")
1032
- end
1052
+ $stderr.puts("Finished #{File.basename(dir)}") if @verbose
1033
1053
  end
1034
1054
  end
1035
1055
  end
@@ -267,7 +267,13 @@ module Simp::Rake::Build::RpmDeps
267
267
  def self.release_file_up_to_date?(new_release_info, rpm_release_file)
268
268
  return false unless File.exist?(rpm_release_file)
269
269
 
270
- return File.read(rpm_release_file).strip == new_release_info.strip
270
+ # remove comments like "# release set by simp-core dependencies.yaml"
271
+ release_file_content = File.readlines(rpm_release_file).reject{|x| x =~ /^ *#/}.join("\n").strip
272
+
273
+ # sanitize numerics, etc.
274
+ new_release_content = "#{new_release_info}".strip
275
+
276
+ return release_file_content == new_release_content
271
277
  end
272
278
 
273
279
  # Generate 'build/rpm_metadata/release' file containing release qualifier
@@ -51,7 +51,8 @@ module Simp::Rake::Build
51
51
  'rubygem-simp-cli',
52
52
  'simp',
53
53
  'simp-gpgkeys',
54
- 'simp-utils'
54
+ 'simp-utils',
55
+ 'simp-vendored-r10k'
55
56
  ]
56
57
  }
57
58
 
@@ -83,8 +84,11 @@ module Simp::Rake::Build
83
84
  end
84
85
 
85
86
  unless failures.empty?
86
- msg = ['Error: Could not find the following packages:']
87
- fail((msg + failures).join("\n"))
87
+ msg = ['Error: Could not find the following packages:'] +
88
+ failures +
89
+ ['Did "dist/logs/last_rpm_build_metadata.yaml" get generated in the build directory?']
90
+
91
+ fail(msg.join("\n"))
88
92
  end
89
93
  end
90
94
  end
@@ -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.6'
5
+ VERSION = '5.12.7'
6
6
  end
@@ -342,7 +342,7 @@ describe 'rake pkg:signrpms and pkg:checksig' do
342
342
  end
343
343
 
344
344
  hosts.each do |host|
345
- os_major = fact_on(host,'operatingsystemmajrelease')
345
+ os_major = fact_on(host,'os.release.major')
346
346
  if os_major > '7'
347
347
  # this problem only happens on EL > 7 in a docker container
348
348
  describe "when gpg-agent's socket path is too long on #{host}" do
@@ -378,7 +378,7 @@ describe 'rake pkg:signrpms and pkg:checksig' do
378
378
  :acceptable_exit_codes => [1]
379
379
  )
380
380
 
381
- err_msg = %r(Failed to sign #{test_rpm} in 5 seconds)
381
+ err_msg = %r(Failed to sign)
382
382
  expect(result.stderr).to match(err_msg)
383
383
 
384
384
  signature_check = on(host, "rpm -qip '#{test_rpm}' | grep ^Signature", run_opts)
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.6
4
+ version: 5.12.7
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-10-21 00:00:00.000000000 Z
12
+ date: 2021-10-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simp-beaker-helpers