simp-rake-helpers 6.0.0 → 6.1.0

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: a5c6dcd39818c575a5e55c997ea3425895952a3913e743f8472f1368c86324c5
4
- data.tar.gz: 562f3641c404e562a1d64cec2fa4b11f4e3206d9a0c4c1605c2f60651f87a0b0
3
+ metadata.gz: 187143b51a314e79b65f0e1392213c5569ea67f776d1f84e75382f3424d43ce2
4
+ data.tar.gz: a75929e673723f7ce4a9a36398a98fad8994c0e94e69f0dd9aebc30bb62bd230
5
5
  SHA512:
6
- metadata.gz: 365f2731d24ee8ea5d830a6d055ecd024bf2a1bf448bfffdb259a88126244ae81ea3fbd4704d2b92241380a7ba45ce3962beb2d58bc2213a3dd537820604b5eb
7
- data.tar.gz: c2f1258d8ee380d03667c852f48222e4f4b2de2865d49abf9ee5a95d523c3c4a36f972e1edf8562a590c254e493e0d6edb798213e2f21914f3b90017eb919764
6
+ metadata.gz: 5a703c78bca2339cfef781ee2b253fb4e03cd1333e1fd38bffe610ad63c94148b21a2c257051ece7f3d19eb241a49834df0b9fa73661cc6d7dd582d14d1eafe1
7
+ data.tar.gz: 5870971485f38854c577f41cfd086a20ac72065a460f48a65041c7cb195eca8ee1d71f796792f871bc4c90ab36b1387430aead64afe2834fd138c1a7e46e3378
data/CHANGELOG.md CHANGED
@@ -1,3 +1,56 @@
1
+ ### 6.1.0 / 2026-09-03
2
+ - Added
3
+ - Absorbed `Simp::Build::ReleaseMapper` from the unmaintained
4
+ `simp-build-helpers` gem into `lib/simp/build/release_mapper.rb`, along with
5
+ its unit tests. `simp/rake/build/auto.rb` has always hard-required this
6
+ class, but it was never declared as a runtime dependency -- only as a
7
+ `Gemfile` entry -- so `gem install simp-rake-helpers` produced a `LoadError`
8
+ for the entire `Simp::Rake::Build::*` task tree.
9
+ - The last release of `simp-build-helpers` was 0.1.1 (2016-09-28), which
10
+ calls `File.exists?`. That method no longer exists in current Rubies, so
11
+ `rake build:auto` raised `NoMethodError` on its first ISO path check.
12
+ The fix had been committed to that project's `master` but never released.
13
+ - Changed
14
+ - `Simp::Build::SIMPBuildException` now inherits from `StandardError` rather
15
+ than `Exception`, matching the other `SIMPBuildException` classes in this
16
+ project. `build:auto` wraps each distro/version/arch build in
17
+ `rescue StandardError`, so ISO mapping failures are now recorded per-ISO and
18
+ reported in the "Failed ISOs" summary (exit 1) instead of aborting the whole
19
+ run on the first failure.
20
+ - Dropped the `simp-build-helpers` `Gemfile` entry and removed it from the
21
+ acceptance-test build project scaffold.
22
+ - Fixed
23
+ - `Simp::Build::ReleaseMapper#get_flavor` no longer reports a flavor match with
24
+ an empty ISO list when checksum verification fails. When the checksum branch
25
+ was taken (`SIMP_BUILD_checksum=true`, or a flavor with non-unique ISO sizes)
26
+ and verification failed, control fell through to an unconditional
27
+ `result = flavor` instead of moving on to the next flavor, so a corrupt or
28
+ unrecognized ISO was accepted as a valid match. `build:auto` iterates
29
+ `target_data['isos']` to drive `unpack`, so the empty list silently skipped
30
+ unpacking and the build continued against an empty or stale staging
31
+ directory -- making `SIMP_BUILD_checksum=true` worse than useless. It now
32
+ keeps searching and raises `No flavors for target release` when nothing
33
+ verifies. Inherited from `simp-build-helpers`, where the `else` appears to
34
+ have been lost long ago.
35
+ - Added the missing closing quote in the "Recognized SIMP ISOs for '<release>'"
36
+ error message header.
37
+
38
+ ### 6.0.1 / 2026-08-26
39
+ - Fixed
40
+ - `pkg:check_version` no longer misreads CHANGELOG versions with a two-digit
41
+ major. It parsed the entry with its own regex whose greedy leading match
42
+ consumed the first digit of the major, so `12.2.1` was read as `2.2.1` and
43
+ reported as out of date. It now uses
44
+ `Simp::ComponentInfo::CHANGELOG_ENTRY_REGEX`, the same entry regex used by
45
+ `Simp::ComponentInfo` and `Simp::RelChecks`. Affected every component
46
+ released since `10.0.0`; single-digit majors were unaffected.
47
+ - `pkg:check_version` now reports a malformed newest CHANGELOG entry instead
48
+ of skipping it. Skipping fell through to an older entry and reported that
49
+ entry's stale version as out of date, pointing at the wrong problem.
50
+ - The deprecated top-level `compare_latest_tag` task now uses the
51
+ `CHANGELOG_ENTRY_REGEX` constant already defined in its own class instead of
52
+ an inline copy that had drifted (it required a zero-padded day).
53
+
1
54
  ### 6.0.0 / 2026-06-25
2
55
  - Added
3
56
  - `pupmod:build` rake task using `puppet-modulebuilder`, replacing `pdk build`
data/Gemfile CHANGED
@@ -11,7 +11,6 @@ gem_sources.each { |gem_source| source gem_source }
11
11
 
12
12
  gemspec
13
13
 
14
- gem 'simp-build-helpers'
15
14
  # renovate: datasource=rubygems versioning=ruby
16
15
  gem 'simp-beaker-helpers', ENV.fetch('SIMP_BEAKER_HELPERS_VERSION', '~> 3.0')
17
16
  gem 'beaker_puppet_helpers'
@@ -0,0 +1,153 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'yaml'
4
+
5
+ module Simp; end
6
+
7
+ module Simp::Build
8
+ class SIMPBuildException < StandardError; end
9
+
10
+ # Maps a target SIMP release to the base OS ISOs required to build it.
11
+ #
12
+ # Reads a `release_mappings.yaml` (from simp-core's
13
+ # `build/distributions/<distro>/<version>/<arch>/`) and matches a set of
14
+ # candidate ISO files against the flavors known for the target release.
15
+ #
16
+ # Absorbed from the `simp-build-helpers` gem, which is no longer maintained
17
+ # as a separate project.
18
+ class ReleaseMapper
19
+ attr_accessor :do_checksums, :verbose
20
+
21
+ def initialize(target_release, mappings_file, do_checksums = false)
22
+ @target_release = target_release
23
+ @mappings_file = mappings_file
24
+ @release_mappings = YAML.load_file(mappings_file)
25
+ @target_data = get_release_mappings_for_target(@target_release, @release_mappings)
26
+ @do_checksums = do_checksums
27
+ @verbose = false
28
+ end
29
+
30
+ def get_release_mappings_for_target(target_release, release_mappings)
31
+ releases = release_mappings.fetch('simp_releases')
32
+ target_data = releases.fetch(target_release, false)
33
+
34
+ unless target_data
35
+ known = releases.keys.map { |x| " - #{x}\n" }.join
36
+
37
+ raise SIMPBuildException,
38
+ "'#{target_release}' is not a recognized SIMP release.\n\n" \
39
+ "## Recognized SIMP releases:\n#{known}\n\n"
40
+ end
41
+
42
+ target_data
43
+ end
44
+
45
+ # Given a path string of files or directories, return a list of .iso files
46
+ # - if all paths are bad, the result is an empty array
47
+ # - directories are scanned for .iso files
48
+ def sanitize_iso_list(paths_string)
49
+ paths_string.split(':').flat_map { |path|
50
+ if File.directory?(path)
51
+ Dir[File.join(path, '*.iso')]
52
+ elsif File.file?(path)
53
+ path
54
+ else
55
+ []
56
+ end
57
+ }.sort.uniq
58
+ end
59
+
60
+ # Given a list of isos: see if any match the complete set of ISOs for one
61
+ # of the target_release's flavors. If it matches, return a Hash containing
62
+ # the flavor and the matched ISOs. If they didn't match any known distros,
63
+ # return nil
64
+ #
65
+ # Some of the `isos` lists might be superfluous
66
+ def get_flavor(isos)
67
+ iso_sizes = isos.map { |iso| [iso, File.size(iso)] }.sort.to_h
68
+ result = false
69
+ result_isos = []
70
+
71
+ @target_data['flavors'].each do |flavor, data|
72
+ sizes = data['isos'].map { |x| x['size'] }.sort
73
+ next unless sizes.uniq == sizes & iso_sizes.values
74
+
75
+ matched_isos = iso_sizes.select { |_iso, size| sizes.include?(size) }.keys
76
+ result_isos = matched_isos
77
+
78
+ if @do_checksums || (sizes.uniq.size != sizes.size)
79
+ checksums = data['isos'].map { |x| x['checksum'] }
80
+
81
+ iso_checksums = matched_isos.to_h do |iso|
82
+ puts "=== getting checksum of '#{iso}'" if @verbose
83
+
84
+ [iso, `sha256sum "#{iso}"`.split(%r{ +}).first]
85
+ end
86
+
87
+ matched_isos = iso_checksums.select { |_iso, sum| checksums.include?(sum) }
88
+
89
+ # The checksums did not account for every ISO this flavor expects, so
90
+ # it is not a match. Keep looking rather than falling through and
91
+ # reporting the flavor with an empty ISO list.
92
+ next unless matched_isos.values.uniq.size == checksums.uniq.size
93
+
94
+ result = flavor
95
+ result_isos = matched_isos.keys.dup
96
+ break
97
+ end
98
+
99
+ result = flavor
100
+ break
101
+ end
102
+
103
+ return nil unless result
104
+
105
+ @target_data['flavors'][result].merge({ 'flavor' => result, 'isos' => result_isos })
106
+ end
107
+
108
+ def autoscan_unpack_list(paths_string)
109
+ iso_paths = sanitize_iso_list(paths_string)
110
+
111
+ if iso_paths.empty?
112
+ raise SIMPBuildException,
113
+ "ERROR: No suitable ISOs found for target release '#{@target_release}' in '#{paths_string}'.\n\n" \
114
+ "## Recognized SIMP ISOs for '#{@target_release}':\n\n#{recognized_isos}\n\n"
115
+ end
116
+
117
+ unpack_files = get_flavor(iso_paths)
118
+
119
+ if unpack_files.nil?
120
+ raise SIMPBuildException,
121
+ "ERROR: No flavors for target release '#{@target_release}' found in '#{paths_string}'.\n\n" \
122
+ "## Recognized SIMP ISOs for '#{@target_release}':\n\n#{recognized_isos(detailed: true)}\n\n"
123
+ end
124
+
125
+ unpack_files
126
+ end
127
+
128
+ private
129
+
130
+ # Formatted list of the ISOs known for the target release, for use in error
131
+ # messages. When `detailed` is set, each ISO's expected size and checksum
132
+ # are listed along with its name.
133
+ def recognized_isos(detailed: false)
134
+ max_iso_name_size = @target_data['flavors'].values.flat_map { |x| x['isos'] }.map { |x| x['name'].size }.max
135
+
136
+ @target_data.fetch('flavors').map { |flavor, data|
137
+ isos = data['isos'].map { |x|
138
+ if detailed
139
+ [
140
+ " - #{x['name'].ljust(max_iso_name_size)}",
141
+ " - size: #{x['size']}",
142
+ " - checksum: #{x['checksum']}",
143
+ ].join("\n")
144
+ else
145
+ " - #{x['name']}"
146
+ end
147
+ }.join("\n")
148
+
149
+ " ### #{flavor}\n\n#{isos}\n\n"
150
+ }.join
151
+ end
152
+ end
153
+ end
@@ -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', '~> 5.0'
11
+ gem 'simp-rake-helpers', '~> 6.0'
@@ -4,5 +4,5 @@ module Simp; end
4
4
  module Simp::Rake; end
5
5
 
6
6
  class Simp::Rake::Helpers
7
- VERSION = '6.0.0'
7
+ VERSION = '6.1.0'
8
8
  end
data/lib/simp/rake/pkg.rb CHANGED
@@ -9,6 +9,7 @@ require 'rake/clean'
9
9
  require 'rake/tasklib'
10
10
  require 'fileutils'
11
11
  require 'find'
12
+ require 'simp/componentinfo'
12
13
  require 'simp/relchecks'
13
14
  require 'simp/rpm'
14
15
  require 'simp/rake/helpers/rpm_spec'
@@ -475,15 +476,35 @@ class Simp::Rake::Pkg < Rake::TaskLib
475
476
  changelog = File.read('CHANGELOG')
476
477
  changelog_version = nil
477
478
 
478
- # Find the first date line
479
+ # Only the newest entry is considered; it is the one that
480
+ # has to agree with metadata.json.
481
+ #
482
+ # Use the shared entry regex rather than an ad hoc one: a
483
+ # greedy leading match swallows the first digit of a
484
+ # two-digit major version (12.2.1 parsed as 2.2.1).
485
+ #
486
+ # Report a malformed newest entry instead of skipping it.
487
+ # Skipping falls through to an older entry and blames its
488
+ # stale version, pointing at the wrong problem.
489
+ malformed_entry = nil
490
+
479
491
  changelog.each_line do |line|
480
- if line =~ %r{\*.*(\d+\.\d+\.\d+)(-\d+)?\s*$}
481
- changelog_version = ::Regexp.last_match(1)
482
- break
492
+ next unless line.start_with?('*')
493
+
494
+ match = Simp::ComponentInfo::CHANGELOG_ENTRY_REGEX.match(line)
495
+
496
+ if match
497
+ changelog_version = match[3]
498
+ else
499
+ malformed_entry = line.strip
483
500
  end
501
+
502
+ break
484
503
  end
485
504
 
486
- if changelog_version
505
+ if malformed_entry
506
+ puts "#{@pkg_name}: Error: Malformed CHANGELOG entry: '#{malformed_entry}'"
507
+ elsif changelog_version
487
508
  if changelog_version == mod_version
488
509
  puts success_msg
489
510
  else
@@ -367,7 +367,7 @@ class Simp::Rake::Pupmod::Helpers < Rake::TaskLib
367
367
  # determine latest version from CHANGELOG, which will present
368
368
  # for all SIMP Puppet modules
369
369
  line = File.readlines('CHANGELOG')[0]
370
- match = line.match(%r{^\*\s+((?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \d{2} \d{4})\s+(.+<.+>)(?:\s+|\s*-\s*)?(\d+\.\d+\.\d+)})
370
+ match = line.match(CHANGELOG_ENTRY_REGEX)
371
371
  unless match
372
372
  raise("ERROR: Invalid CHANGELOG entry. Unable to extract version from '#{line}'")
373
373
  end
@@ -17,7 +17,6 @@ module Simp::BeakerHelpers::SimpRakeHelpers::BuildProjectHelpers
17
17
  gem_sources = ENV.fetch('GEM_SERVERS','https://rubygems.org').split(/[, ]+/)
18
18
  gem_sources.each { |gem_source| source gem_source }
19
19
  gem 'simp-rake-helpers', :path => '#{build_user_host_files}'
20
- gem 'simp-build-helpers', ENV.fetch('SIMP_BUILD_HELPERS_VERSION', '>= 0.1.0')
21
20
  GEMFILE
22
21
  create_remote_file(hosts, "#{test_dir}/Gemfile", gemfile, opts)
23
22
  on(hosts, "chown build_user:build_user #{test_dir}/Gemfile", opts)
@@ -0,0 +1,184 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+ require 'simp/build/release_mapper'
5
+
6
+ describe Simp::Build::ReleaseMapper do
7
+ let(:files_dir) { File.expand_path('../files/release_mapper', File.dirname(__FILE__)) }
8
+ let(:mappings_path) { File.join(files_dir, 'release_mappings.yaml') }
9
+ let(:empty_iso_dir) { File.join(files_dir, 'fake_isos_empty') }
10
+
11
+ let(:iso_paths) do
12
+ pwd = File.join(files_dir, 'fake_isos')
13
+
14
+ {
15
+ 'c7-64' => File.join(pwd, 'CentOS-7-x86_64-DVD-1511.iso'),
16
+ 'r7-64' => File.join(pwd, 'RedHat-7.2-x86_64-DVD.iso'),
17
+ 'c7-64-1503-1' => File.join(pwd, 'CentOS-7-x86_64-DVD-1503-01.iso'),
18
+ 'c67-64-1' => File.join(pwd, 'CentOS-6.7-x86_64-bin-DVD1.iso'),
19
+ 'c67-64-2' => File.join(pwd, 'CentOS-6.7-x86_64-bin-DVD2.iso'),
20
+ 'bad' => File.join(pwd, 'this', 'path', 'should', 'fail'),
21
+ 'c67-false-positive' => File.join(pwd, 'CentOS-6.7-false-positive.iso')
22
+ }
23
+ end
24
+
25
+ let(:mapper) { described_class.new('5.1.X', mappings_path) }
26
+
27
+ describe '#initialize' do
28
+ it 'runs without errors' do
29
+ expect { described_class.new('5.1.X', mappings_path) }.not_to raise_error
30
+ end
31
+
32
+ it 'raises an error for an unrecognized release' do
33
+ expect { described_class.new('0.0.X', mappings_path) }.to raise_error(Simp::Build::SIMPBuildException, %r{is not a recognized SIMP release})
34
+ end
35
+ end
36
+
37
+ describe '#sanitize_iso_list' do
38
+ it 'returns a 1-element list given a valid file' do
39
+ list = mapper.sanitize_iso_list(iso_paths['c7-64'])
40
+
41
+ expect(list).to be_a(Array)
42
+ expect(list.size).to eq 1
43
+ end
44
+
45
+ it 'returns a 2-element list given two valid files (delimited by ":")' do
46
+ list = mapper.sanitize_iso_list([iso_paths['c67-64-1'], iso_paths['c67-64-2']].join(':'))
47
+
48
+ expect(list).to be_a(Array)
49
+ expect(list.size).to eq 2
50
+ end
51
+
52
+ it 'returns a list with one iso given the file' do
53
+ list = mapper.sanitize_iso_list(iso_paths['c7-64'])
54
+
55
+ expect(list).to be_a(Array)
56
+ expect(list).to all(include('.iso'))
57
+ end
58
+
59
+ it 'returns a list of isos in a directory' do
60
+ list = mapper.sanitize_iso_list(File.dirname(iso_paths['c7-64']))
61
+
62
+ expect(list).to be_a(Array)
63
+ expect(list).to all(include('.iso'))
64
+ end
65
+
66
+ it 'returns an empty list for a non-existent path' do
67
+ list = mapper.sanitize_iso_list(iso_paths['bad'])
68
+
69
+ expect(list).to be_a(Array)
70
+ expect(list).to be_empty
71
+ end
72
+
73
+ it 'returns an empty list for an empty directory' do
74
+ list = mapper.sanitize_iso_list(empty_iso_dir)
75
+
76
+ expect(list).to be_a(Array)
77
+ expect(list).to be_empty
78
+ end
79
+ end
80
+
81
+ describe '#get_flavor' do
82
+ it 'detects CentOS flavor for known file' do
83
+ list = [iso_paths['c7-64']]
84
+ data = mapper.get_flavor(list)
85
+
86
+ expect(data['flavor']).to eq('CentOS')
87
+ expect(data['isos']).to eq(list)
88
+ end
89
+
90
+ it 'detects RedHat flavor for known file' do
91
+ list = [iso_paths['r7-64']]
92
+ data = mapper.get_flavor(list)
93
+
94
+ expect(data['flavor']).to eq('RedHat')
95
+ expect(data['isos']).to eq(list)
96
+ end
97
+
98
+ it 'detects RedHat flavor and correct ISO from multiple files' do
99
+ list = [iso_paths['c67-64-1'], iso_paths['c67-64-2'], iso_paths['r7-64']]
100
+ data = mapper.get_flavor(list)
101
+
102
+ expect(data['flavor']).to eq('RedHat')
103
+ expect(data['isos']).to eq([iso_paths['r7-64']])
104
+ end
105
+
106
+ it 'detects CentOS flavor and correct ISOs from multiple files' do
107
+ mapper = described_class.new('4.2.X', mappings_path)
108
+ list = [iso_paths['c67-64-1'], iso_paths['c67-64-2'], iso_paths['r7-64']]
109
+ data = mapper.get_flavor(list)
110
+
111
+ expect(data['flavor']).to eq('CentOS')
112
+ expect(data['isos']).to eq([iso_paths['c67-64-1'], iso_paths['c67-64-2']])
113
+ end
114
+
115
+ it 'returns nil when unable to detect a known flavor' do
116
+ list = [iso_paths['c67-64-1'], iso_paths['c67-64-2']]
117
+
118
+ expect(mapper.get_flavor(list)).to be_nil
119
+ end
120
+
121
+ it 'detects CentOS flavor when checksums are enabled' do
122
+ mapper = described_class.new('4.2.X', mappings_path, true)
123
+ list = [iso_paths['c67-64-1'], iso_paths['c67-64-2'], iso_paths['c67-false-positive']]
124
+
125
+ expect(mapper.get_flavor(list)['flavor']).to eq('CentOS')
126
+ end
127
+
128
+ # The sizes match, so the flavor is a size-level candidate, but the
129
+ # checksums do not account for every ISO the flavor expects. This used to
130
+ # fall through and report the flavor with an empty ISO list, which
131
+ # `build:auto` then silently skipped unpacking.
132
+ it 'returns nil when checksums are enabled and verification fails' do
133
+ mapper = described_class.new('4.2.X', mappings_path, true)
134
+ list = [iso_paths['c67-false-positive']]
135
+
136
+ expect(mapper.get_flavor(list)).to be_nil
137
+ end
138
+
139
+ it 'does not report a flavor with an empty ISO list' do
140
+ mapper = described_class.new('4.2.X', mappings_path, true)
141
+ list = [iso_paths['c67-false-positive']]
142
+ data = mapper.get_flavor(list)
143
+
144
+ expect(data && data['isos']).not_to eq([])
145
+ end
146
+ end
147
+
148
+ describe '#autoscan_unpack_list' do
149
+ it 'autodetects 5.1.X unpack ISO from multiple directories' do
150
+ path_string = [File.dirname(iso_paths['c7-64']), empty_iso_dir].join(':')
151
+ data = mapper.autoscan_unpack_list(path_string)
152
+
153
+ expect(data).not_to be_nil
154
+ expect(data['flavor']).to eq('CentOS')
155
+ expect(data['isos']).to eq [iso_paths['c7-64']]
156
+ end
157
+
158
+ it 'autodetects 4.2.X unpack ISOs from multiple directories' do
159
+ path_string = [File.dirname(iso_paths['c67-64-1']), empty_iso_dir].join(':')
160
+ mapper = described_class.new('4.2.X', mappings_path, true)
161
+ data = mapper.autoscan_unpack_list(path_string)
162
+
163
+ expect(data).not_to be_nil
164
+ expect(data['flavor']).to eq('CentOS')
165
+ expect(data['isos'].sort).to eq [iso_paths['c67-64-1'], iso_paths['c67-64-2']]
166
+ end
167
+
168
+ it 'raises an error when no disks are found' do
169
+ expect { mapper.autoscan_unpack_list(iso_paths['bad']) }.to raise_error(Simp::Build::SIMPBuildException, %r{No suitable ISOs found})
170
+ end
171
+
172
+ it "raises an error when no disks match the target's flavors" do
173
+ path_string = [iso_paths['c67-64-1'], iso_paths['c67-64-2']].join(':')
174
+
175
+ expect { mapper.autoscan_unpack_list(path_string) }.to raise_error(Simp::Build::SIMPBuildException, %r{No flavors for target release})
176
+ end
177
+
178
+ it 'raises an error when checksums are enabled and verification fails' do
179
+ mapper = described_class.new('4.2.X', mappings_path, true)
180
+
181
+ expect { mapper.autoscan_unpack_list(iso_paths['c67-false-positive']) }.to raise_error(Simp::Build::SIMPBuildException, %r{No flavors for target release})
182
+ end
183
+ end
184
+ end
@@ -34,6 +34,17 @@ describe 'Simp::ComponentInfo changelog regex' do
34
34
  expect(result[3]).to eq '3.8.0'
35
35
  expect(result[4]).to be_nil
36
36
  end
37
+
38
+ # A greedy leading match consumes the first digit of the major version,
39
+ # yielding '2.2.1' here. Guards the ad hoc regex that pkg:check_version
40
+ # used to carry.
41
+ it 'captures the full major version of a two-digit major without a release qualifier' do
42
+ line = '* Mon Aug 24 2026 Tom Smith <tom.smith@simp-project.com> - 12.2.1'
43
+ result = line.match(Simp::ComponentInfo::CHANGELOG_ENTRY_REGEX)
44
+ expect(result).not_to be_nil
45
+ expect(result[3]).to eq '12.2.1'
46
+ expect(result[4]).to be_nil
47
+ end
37
48
  end
38
49
 
39
50
  context 'invalid initial changelog lines' do
@@ -0,0 +1 @@
1
+ matches byte size but not csum
@@ -0,0 +1 @@
1
+ CentOS-6.7-x86_64-bin-DVD1.iso
@@ -0,0 +1 @@
1
+ CentOS-6.7-x86_64-bin-DVD2.iso
@@ -0,0 +1 @@
1
+ CentOS-7-x86_64-DVD-1503-01.iso
@@ -0,0 +1 @@
1
+ CentOS-7-x86_64-DVD-1511.iso
@@ -0,0 +1 @@
1
+ RedHat-7.2-x86_64-DVD.iso
@@ -0,0 +1,35 @@
1
+ ---
2
+ simp_releases:
3
+ 5.1.X:
4
+ flavors:
5
+ CentOS:
6
+ isos:
7
+ - name: 'CentOS-7-x86_64-DVD-1511.iso'
8
+ size: 29
9
+ checksum: 'a6525d9649326ff1d10958caa35b7e07cb454ee2419401a0e2ec03914a5c0e29'
10
+ RedHat:
11
+ isos:
12
+ - name: 'RedHat-7.2-x86_64-DVD.iso'
13
+ size: 26
14
+ checksum: '3ddcc08ba4cb90c1ef285aad2bce5bda2fd333fc0645e1db48a9c45b655c8a37'
15
+ build_command: 'bundle exec rake build:from_iso[RedHdat-7-x86_64-DVD-1511.iso]'
16
+ mock_cfg: 'epel-7-x86_64.cfg'
17
+ 5.1.0-2:
18
+ flavors:
19
+ CentOS:
20
+ isos:
21
+ - name: 'CentOS-7-x86_64-DVD-1503-01.iso'
22
+ size: 32
23
+ checksum: '698352c6b47a8a3cab47f2e1ee73722e25797511357787461a2b9e43dbb84ac2'
24
+ build_command: 'bundle exec rake <something-or-other>[CentOS-7-x86_64-DVD-1503-01.iso]'
25
+ mock_cfg: 'epel-7-x86_64.cfg'
26
+ 4.2.X:
27
+ flavors:
28
+ CentOS:
29
+ isos:
30
+ - name: 'CentOS-6.7-x86_64-bin-DVD1.iso'
31
+ size: 31
32
+ checksum: '1de19e772386fa08e82ddbcd00399159945a012ad1536dec76b260f9ef6036c3'
33
+ - name: 'CentOS-6.7-x86_64-bin-DVD1.iso'
34
+ size: 31
35
+ checksum: '8aa797a6d39f7496f1ef97e8b6a959941ee8e20e48bae545e5a96850fca98549'
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: 6.0.0
4
+ version: 6.1.0
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-06-25 00:00:00.000000000 Z
11
+ date: 2026-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simp-beaker-helpers
@@ -376,6 +376,7 @@ files:
376
376
  - LICENSE
377
377
  - README.md
378
378
  - Rakefile
379
+ - lib/simp/build/release_mapper.rb
379
380
  - lib/simp/command_utils.rb
380
381
  - lib/simp/componentinfo.rb
381
382
  - lib/simp/local_gpg_signing_key.rb
@@ -499,6 +500,7 @@ files:
499
500
  - spec/acceptance/suites/default/support/build_user_helpers.rb
500
501
  - spec/acceptance/suites/default/support/pkg_rpm_helpers.rb
501
502
  - spec/acceptance/support/simp_rake_helpers.rb
503
+ - spec/lib/simp/build/release_mapper_spec.rb
502
504
  - spec/lib/simp/command_utils_spec.rb
503
505
  - spec/lib/simp/componentinfo_changelog_regex_spec.rb
504
506
  - spec/lib/simp/componentinfo_spec.rb
@@ -553,6 +555,13 @@ files:
553
555
  - spec/lib/simp/files/relchecks_create_tag_changelog_spec/module_with_single_entry/CHANGELOG
554
556
  - spec/lib/simp/files/relchecks_create_tag_changelog_spec/module_with_single_entry/metadata.json
555
557
  - spec/lib/simp/files/relchecks_create_tag_changelog_spec/module_without_changelog/metadata.json
558
+ - spec/lib/simp/files/release_mapper/fake_isos/CentOS-6.7-false-positive.iso
559
+ - spec/lib/simp/files/release_mapper/fake_isos/CentOS-6.7-x86_64-bin-DVD1.iso
560
+ - spec/lib/simp/files/release_mapper/fake_isos/CentOS-6.7-x86_64-bin-DVD2.iso
561
+ - spec/lib/simp/files/release_mapper/fake_isos/CentOS-7-x86_64-DVD-1503-01.iso
562
+ - spec/lib/simp/files/release_mapper/fake_isos/CentOS-7-x86_64-DVD-1511.iso
563
+ - spec/lib/simp/files/release_mapper/fake_isos/RedHat-7.2-x86_64-DVD.iso
564
+ - spec/lib/simp/files/release_mapper/release_mappings.yaml
556
565
  - spec/lib/simp/files/simp_build/src/assets/simp/build/simp.spec
557
566
  - spec/lib/simp/files/testpackage-1-0.el7.noarch.rpm
558
567
  - spec/lib/simp/files/testpackage-1-0.noarch.rpm
@@ -637,7 +646,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
637
646
  - !ruby/object:Gem::Version
638
647
  version: '0'
639
648
  requirements: []
640
- rubygems_version: 4.0.10
649
+ rubygems_version: 4.0.16
641
650
  specification_version: 4
642
651
  summary: SIMP rake helpers
643
652
  test_files: []