simp-rake-helpers 7.0.0 → 7.0.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17a61d8752d73045b67c31db5865a27333eb179929cbe3547077293196212f9a
4
- data.tar.gz: 3a207e85eb8c285d67cf1f013db9da5f9ce4bef508eea997d796cd3b08632e99
3
+ metadata.gz: b01629a09d8aed1d3738c94e6eb15100a00872932b6912c53ea6727fea783ca7
4
+ data.tar.gz: 913def27f8d722694ce7754839a82d87fb6afd648039a777454edadab5683cd0
5
5
  SHA512:
6
- metadata.gz: cd50a6943242009704ebb20410c4ed70b14af882268b648d6dd5ffbaf206c2394e2244b93bee220e6b40d96baeb86048dd8b8b0cd026afdc1b6c369d0a6f0f89
7
- data.tar.gz: 891d1280e437f99c3a8fdba93b20d7931bfb6e3eaa86887a1eb9e5567f241505436a569eb057f805d979d188b84d92d2a312256fd8f43d5f01df4e2900d51ff1
6
+ metadata.gz: 8aa589802f53f4e5c357918b6391a067e6aeadf8b2ea93d75f62324bcefe399dee35f5012862e6f84f773f2a6748e9eac5c74a078716703a8ff0cbf4d42604cc
7
+ data.tar.gz: a3efa5462279daaa95f1afc17557bd2f828928052262379451b423a697c4537e1f24befac8a5e740ed18717e89c307888acba6139f41d9434ce461716a85af5d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### 7.0.1 / 2026-10-14
2
+ - Fixed
3
+ - RPM builds for SIMP 7 failed with `Could not find template for SIMP
4
+ version 7.0.0-...`, because the RPM spec template was looked up only
5
+ for the exact SIMP major. A SIMP major without its own template now uses
6
+ the newest older one (`simp6.spec` for SIMP 7)
7
+
1
8
  ### 7.0.0 / 2026-10-05
2
9
  - Changed
3
10
  - **BREAKING:** `pkg:compare_latest_tag` decides whether a Puppet module
data/Gemfile CHANGED
@@ -27,6 +27,6 @@ group :test do
27
27
  # rubocop, rubocop-rake, and rubocop-rspec are pulled in and version-pinned by
28
28
  # voxpupuli-test; pinning them here conflicts with its constraints.
29
29
  # rubocop-performance is not a voxpupuli-test dependency, so it stays explicit.
30
- gem 'rubocop-performance', '~> 1.26.0'
30
+ gem 'rubocop-performance', '~> 1.27.0'
31
31
  end
32
32
 
@@ -8,4 +8,4 @@ gem_sources = ENV.key?('SIMP_GEM_SERVERS') ? ENV['SIMP_GEM_SERVERS'].split(/[,
8
8
 
9
9
  gem_sources.each { |gem_source| source gem_source }
10
10
 
11
- gem 'simp-rake-helpers', '~> 6.0'
11
+ gem 'simp-rake-helpers', '~> 7.0'
@@ -9,18 +9,26 @@ class Simp::Rake::Helpers
9
9
 
10
10
  include Simp::Rake::Build::Constants
11
11
 
12
+ TEMPLATE_DIR = File.join(File.dirname(__FILE__), 'assets', 'rpm_spec')
13
+
14
+ # The RPM spec template for a SIMP version: simp<N>.spec for the newest N
15
+ # that does not exceed the version's major, so a new SIMP major keeps
16
+ # using the previous template until it needs a different one. Without a
17
+ # version, simpdefault.spec.
12
18
  def rpm_template(simp_version = nil)
13
19
  simp_version = ENV.fetch('SIMP_BUILD_version', simp_version)
14
20
 
15
- simp_main_version = if simp_version
16
- simp_version.split('.').first
17
- else
18
- 'default'
19
- end
20
-
21
- template_file = File.join(File.dirname(__FILE__), 'assets', 'rpm_spec', "simp#{simp_main_version}.spec")
22
-
23
- raise "Error: Could not find template for SIMP version #{simp_version}" unless File.exist?(template_file)
21
+ template_file = if simp_version
22
+ simp_main_version = simp_version.split('.').first.to_i
23
+ versioned = Dir.glob(File.join(TEMPLATE_DIR, 'simp[0-9]*.spec')).map do |file|
24
+ [File.basename(file)[%r{\d+}].to_i, file]
25
+ end
26
+ versioned.select { |major, _| major <= simp_main_version }.max_by(&:first)&.last
27
+ else
28
+ File.join(TEMPLATE_DIR, 'simpdefault.spec')
29
+ end
30
+
31
+ raise "Error: Could not find template for SIMP version #{simp_version}" unless template_file && File.exist?(template_file)
24
32
 
25
33
  File.read(template_file)
26
34
  end
@@ -4,5 +4,5 @@ module Simp; end
4
4
  module Simp::Rake; end
5
5
 
6
6
  class Simp::Rake::Helpers
7
- VERSION = '7.0.0'
7
+ VERSION = '7.0.1'
8
8
  end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'simp/rake/helpers/rpm_spec'
4
+ require 'spec_helper'
5
+
6
+ describe Simp::Rake::Helpers::RPMSpec do
7
+ subject(:helper) { Class.new { include Simp::Rake::Helpers::RPMSpec }.new }
8
+
9
+ let(:template_dir) { Simp::Rake::Helpers::RPMSpec::TEMPLATE_DIR }
10
+ let(:simp6_template) { File.read(File.join(template_dir, 'simp6.spec')) }
11
+ let(:default_template) { File.read(File.join(template_dir, 'simpdefault.spec')) }
12
+
13
+ around(:each) do |example|
14
+ saved = ENV.delete('SIMP_BUILD_version')
15
+ example.run
16
+ ensure
17
+ saved.nil? ? ENV.delete('SIMP_BUILD_version') : ENV['SIMP_BUILD_version'] = saved
18
+ end
19
+
20
+ it 'uses the template for the exact SIMP major' do
21
+ expect(helper.rpm_template('6.6.0-2')).to eq(simp6_template)
22
+ end
23
+
24
+ it 'falls back to the newest older template for a newer SIMP major' do
25
+ expect(helper.rpm_template('7.0.0-Alpha.el8')).to eq(simp6_template)
26
+ end
27
+
28
+ it 'prefers SIMP_BUILD_version over the argument' do
29
+ ENV['SIMP_BUILD_version'] = '7.0.0-Alpha.el10'
30
+ expect(helper.rpm_template('5.0.0')).to eq(simp6_template)
31
+ end
32
+
33
+ it 'uses the default template without a SIMP version' do
34
+ expect(helper.rpm_template).to eq(default_template)
35
+ end
36
+
37
+ it 'fails for a SIMP major older than every template' do
38
+ expect { helper.rpm_template('5.4.0') }.to raise_error(%r{Could not find template for SIMP version 5\.4\.0})
39
+ end
40
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-rake-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.0
4
+ version: 7.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
8
8
  - Trevor Vaughan
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-10-07 00:00:00.000000000 Z
11
+ date: 2026-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simp-beaker-helpers
@@ -602,6 +602,7 @@ files:
602
602
  - spec/lib/simp/rake/build/files/unmanaged_mod/metadata.json
603
603
  - spec/lib/simp/rake/build/helpers_spec.rb
604
604
  - spec/lib/simp/rake/build/rpmdeps_spec.rb
605
+ - spec/lib/simp/rake/helpers/rpm_spec_spec.rb
605
606
  - spec/lib/simp/rake/helpers_spec.rb
606
607
  - spec/lib/simp/rake/pkg_spec.rb
607
608
  - spec/lib/simp/rake/pupmod/fixtures/othermod/Gemfile