simp-rake-helpers 5.11.0 → 5.11.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 +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile +1 -0
- data/lib/simp/componentinfo.rb +6 -3
- data/lib/simp/rake/helpers/assets/rpm_spec/simp6.spec +15 -1
- data/lib/simp/rake/helpers/assets/rpm_spec/simpdefault.spec +15 -1
- data/lib/simp/rake/helpers/version.rb +1 -1
- data/spec/lib/simp/componentinfo_spec.rb +25 -37
- data/spec/lib/simp/files/componentinfo_spec/module_with_prerelease_dash_in_version/CHANGELOG +14 -0
- data/spec/lib/simp/files/componentinfo_spec/module_with_prerelease_dash_in_version/metadata.json +44 -0
- data/spec/lib/simp/files/testpackage-rc0.spec +32 -0
- data/spec/lib/simp/rpm_spec.rb +5 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 842c7c807e886d28ecc77134d1737609a2bdf1086684437a7f9963ec925cc39c
|
4
|
+
data.tar.gz: feeb1ee8af97de4ad45ed94d845d6767f91a905b98c5f3923528196a4c966d18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ab96c058e9375634c96e5ef949f30880657397efc9b5ed5a49acbd6e575452d568468aa8a6410597a495a2c31a8fc692c3ba049aec11099c398875f184e5399
|
7
|
+
data.tar.gz: 82f08cfae6782f618c682f24c1bc699ea28300d34620d7cce68ab017e795399f577d5d46984098a9553e972f620fab8b60a1027b06ac3e0a95ba0a6c1708daf1
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/simp/componentinfo.rb
CHANGED
@@ -99,9 +99,12 @@ class Simp::ComponentInfo
|
|
99
99
|
require 'json'
|
100
100
|
metadata_file = File.join(@component_dir, 'metadata.json')
|
101
101
|
metadata = JSON.parse(File.read(metadata_file))
|
102
|
-
|
103
|
-
|
104
|
-
|
102
|
+
fail("ERROR: Version missing from #{metadata_file}") if metadata['version'].nil?
|
103
|
+
|
104
|
+
@version = metadata['version'].split('-').first
|
105
|
+
rel_bits = metadata['version'].split('-')[1..-1]
|
106
|
+
@release = rel_bits.empty? ? nil : rel_bits.join('-')
|
107
|
+
|
105
108
|
|
106
109
|
changelog_file = File.join(component_dir, 'CHANGELOG')
|
107
110
|
unless File.exists?(changelog_file)
|
@@ -196,14 +196,28 @@ end
|
|
196
196
|
|
197
197
|
-- Get the Module Version
|
198
198
|
|
199
|
-
|
199
|
+
-- Note on '-rc0' style Release versions in metadata.json:
|
200
|
+
-- Some Puppet orgs (like voxpupuli) append '-rc0' to the module version
|
201
|
+
-- to denote prerelease status and act as a safety check (because the Forge
|
202
|
+
-- only accepts release in SemVer \d+\.\d+\.\d+ release format)
|
203
|
+
--
|
204
|
+
-- This code will remove a '-rc0' style prerelease string from the RPM
|
205
|
+
-- Version, and use it as the default RPM Release (instead of '-0')
|
200
206
|
|
207
|
+
local version_match = metadata:match('"version":%s+"(.-)"%s*,'):gsub('-.*','')
|
201
208
|
if version_match then
|
202
209
|
package_version = version_match
|
203
210
|
else
|
204
211
|
error("Could not find valid package version in 'metadata.json'", 0)
|
205
212
|
end
|
206
213
|
|
214
|
+
-- Get the Module Release (if present)
|
215
|
+
|
216
|
+
local release_match = metadata:match('"version":%s+"[%d.]+-([^"]+)"')
|
217
|
+
|
218
|
+
if release_match then
|
219
|
+
package_release = release_match
|
220
|
+
end
|
207
221
|
}
|
208
222
|
|
209
223
|
%{lua:
|
@@ -196,14 +196,28 @@ end
|
|
196
196
|
|
197
197
|
-- Get the Module Version
|
198
198
|
|
199
|
-
|
199
|
+
-- Note on '-rc0' style Release versions in metadata.json:
|
200
|
+
-- Some Puppet orgs (like voxpupuli) append '-rc0' to the module version
|
201
|
+
-- to denote prerelease status and act as a safety check (because the Forge
|
202
|
+
-- only accepts release in SemVer \d+\.\d+\.\d+ release format)
|
203
|
+
--
|
204
|
+
-- This code will remove a '-rc0' style prerelease string from the RPM
|
205
|
+
-- Version, and use it as the default RPM Release (instead of '-0')
|
200
206
|
|
207
|
+
local version_match = metadata:match('"version":%s+"(.-)"%s*,'):gsub('-.*','')
|
201
208
|
if version_match then
|
202
209
|
package_version = version_match
|
203
210
|
else
|
204
211
|
error("Could not find valid package version in 'metadata.json'", 0)
|
205
212
|
end
|
206
213
|
|
214
|
+
-- Get the Module Release (if present)
|
215
|
+
|
216
|
+
local release_match = metadata:match('"version":%s+"[%d.]+-([^"]+)"')
|
217
|
+
|
218
|
+
if release_match then
|
219
|
+
package_release = release_match
|
220
|
+
end
|
207
221
|
}
|
208
222
|
|
209
223
|
%{lua:
|
@@ -7,14 +7,11 @@ describe Simp::ComponentInfo do
|
|
7
7
|
}
|
8
8
|
|
9
9
|
context 'with valid module input' do
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
expect( info.version ).to eq '3.8.0'
|
16
|
-
expect( info.release ).to be nil
|
17
|
-
expected_changelog = [
|
10
|
+
let(:component_dir){ File.join(files_dir, 'module') }
|
11
|
+
let(:info){ Simp::ComponentInfo.new(component_dir) }
|
12
|
+
let(:expected_release) { nil }
|
13
|
+
let(:expected_changelog) do
|
14
|
+
[
|
18
15
|
{
|
19
16
|
:date => 'Wed Nov 15 2017',
|
20
17
|
:version => '3.8.0',
|
@@ -56,37 +53,28 @@ describe Simp::ComponentInfo do
|
|
56
53
|
]
|
57
54
|
}
|
58
55
|
]
|
59
|
-
expect(info.changelog).to eq expected_changelog
|
60
56
|
end
|
61
57
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
expect( info.
|
66
|
-
expect( info.
|
67
|
-
expect(
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
:release => '0',
|
83
|
-
:content => [
|
84
|
-
'* Mon Nov 06 2017 Tom Smith <tom.smith@simp.com> - 3.8.0-0',
|
85
|
-
'- Fixes split failure when "findmnt" does not exist on Linux'
|
86
|
-
]
|
87
|
-
}
|
88
|
-
]
|
89
|
-
expect(info.changelog).to eq expected_changelog
|
58
|
+
shared_examples 'an instance with expected module data' do
|
59
|
+
it { expect( info.component_dir ).to eq component_dir }
|
60
|
+
it { expect( info.type ).to eq :module }
|
61
|
+
it { expect( info.version ).to eq '3.8.0' }
|
62
|
+
it { expect( info.release ).to eq expected_release }
|
63
|
+
it { expect(info.changelog).to eq expected_changelog }
|
64
|
+
end
|
65
|
+
|
66
|
+
it_behaves_like 'an instance with expected module data'
|
67
|
+
|
68
|
+
context 'with loads version and latest-version-only changelog info' do
|
69
|
+
let(:info){Simp::ComponentInfo.new(component_dir, true)}
|
70
|
+
let(:expected_changelog){ super()[0..1] }
|
71
|
+
it_behaves_like 'an instance with expected module data'
|
72
|
+
end
|
73
|
+
|
74
|
+
context 'with a module version containing a prerelease suffix (3.8.0-rc0)' do
|
75
|
+
let(:component_dir){ File.join(files_dir, 'module_with_prerelease_dash_in_version') }
|
76
|
+
let(:expected_release){ 'rc0' }
|
77
|
+
it_behaves_like 'an instance with expected module data'
|
90
78
|
end
|
91
79
|
end
|
92
80
|
|
@@ -0,0 +1,14 @@
|
|
1
|
+
* Wed Nov 15 2017 Mary Jones <mary.jones@simp.com> - 3.8.0-0
|
2
|
+
- Disable deprecation warnings by default
|
3
|
+
|
4
|
+
* Mon Nov 06 2017 Tom Smith <tom.smith@simp.com> - 3.8.0-0
|
5
|
+
- Fixes split failure when "findmnt" does not exist on Linux
|
6
|
+
|
7
|
+
* Thu Oct 26 2017 Mary Jones <mary.jones@simp.com> - 3.7.0-0
|
8
|
+
- Add Mod::Macaddress data type
|
9
|
+
|
10
|
+
* Tue Sep 26 2017 Joe Brown <joe.brown@simp.com> - 3.6.0-0
|
11
|
+
- Convert all 'sysctl' 'kernel.shm*' entries to Strings
|
12
|
+
- shmall and shmmax were causing Facter and newer versions of Puppet to crash
|
13
|
+
- See FACT-1732 for additional information
|
14
|
+
- Add Puppet function `mod::assert_metadata_os()`
|
data/spec/lib/simp/files/componentinfo_spec/module_with_prerelease_dash_in_version/metadata.json
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
{
|
2
|
+
"name": "simp-module",
|
3
|
+
"version": "3.8.0-rc0",
|
4
|
+
"author": "SIMP Team",
|
5
|
+
"summary": "A collection of common SIMP functions, facts, and types",
|
6
|
+
"license": "Apache-2.0",
|
7
|
+
"source": "https://github.com/simp/pupmod-simp-simplib",
|
8
|
+
"project_page": "https://github.com/simp/pupmod-simp-simplib",
|
9
|
+
"issues_url": "https://simp-project.atlassian.net",
|
10
|
+
"tags": [
|
11
|
+
"simp",
|
12
|
+
"functions",
|
13
|
+
"facts",
|
14
|
+
"types",
|
15
|
+
"alias",
|
16
|
+
"library"
|
17
|
+
],
|
18
|
+
"dependencies": [
|
19
|
+
|
20
|
+
],
|
21
|
+
"operatingsystem_support": [
|
22
|
+
{
|
23
|
+
"operatingsystem": "RedHat",
|
24
|
+
"operatingsystemrelease": [
|
25
|
+
"6",
|
26
|
+
"7"
|
27
|
+
]
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"operatingsystem": "CentOS",
|
31
|
+
"operatingsystemrelease": [
|
32
|
+
"6",
|
33
|
+
"7"
|
34
|
+
]
|
35
|
+
}
|
36
|
+
],
|
37
|
+
"requirements": [
|
38
|
+
{
|
39
|
+
"name": "puppet",
|
40
|
+
"version_requirement": ">= 4.7.0 < 6.0.0"
|
41
|
+
}
|
42
|
+
],
|
43
|
+
"package_release_version": "0"
|
44
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
Name: testpackage
|
2
|
+
Version: 1.0.0
|
3
|
+
Release: rc0
|
4
|
+
Summary: dummy test package
|
5
|
+
BuildArch: noarch
|
6
|
+
|
7
|
+
License: Apache-2.0
|
8
|
+
URL: http://foo.bar
|
9
|
+
|
10
|
+
%description
|
11
|
+
A dummy package used to test Simp::RPM methods
|
12
|
+
|
13
|
+
%prep
|
14
|
+
exit 0
|
15
|
+
|
16
|
+
%build
|
17
|
+
exit 0
|
18
|
+
|
19
|
+
|
20
|
+
%install
|
21
|
+
exit 0
|
22
|
+
|
23
|
+
%clean
|
24
|
+
exit 0
|
25
|
+
|
26
|
+
%files
|
27
|
+
%doc
|
28
|
+
|
29
|
+
|
30
|
+
%changelog
|
31
|
+
* Wed Jun 10 2015 nobody
|
32
|
+
- some comment
|
data/spec/lib/simp/rpm_spec.rb
CHANGED
@@ -20,6 +20,9 @@ describe Simp::RPM do
|
|
20
20
|
@d_rpm_file = File.join( dir, 'testpackage-1-0.el7.noarch.rpm' )
|
21
21
|
@d_rpm_obj = Simp::RPM.new( @d_rpm_file )
|
22
22
|
|
23
|
+
@rc0_spec_file = File.join( dir, 'testpackage-rc0.spec' )
|
24
|
+
@rc0_spec_obj = Simp::RPM.new( @rc0_spec_file )
|
25
|
+
|
23
26
|
#FIXME
|
24
27
|
# @signed_rpm_file = File.join( dir, 'testpackage-1-0.noarch.rpm' )
|
25
28
|
# @signed_rpm_obj = Simp::RPM.new( @signed_rpm_file )
|
@@ -85,6 +88,7 @@ describe Simp::RPM do
|
|
85
88
|
expect( @m_spec_obj.version ).to eq '1'
|
86
89
|
expect( @m_spec_obj.version('testpackage') ).to eq '1'
|
87
90
|
expect( @m_spec_obj.version('testpackage-doc') ).to eq '1.0.1'
|
91
|
+
expect( @rc0_spec_obj.version ).to eq '1.0.0'
|
88
92
|
end
|
89
93
|
|
90
94
|
it 'fails when invalid package specified' do
|
@@ -103,6 +107,7 @@ describe Simp::RPM do
|
|
103
107
|
expect( @m_spec_obj.release ).to eq '0'
|
104
108
|
expect( @m_spec_obj.release('testpackage') ).to eq '0'
|
105
109
|
expect( @m_spec_obj.release('testpackage-doc') ).to eq '2'
|
110
|
+
expect( @rc0_spec_obj.release ).to eq 'rc0'
|
106
111
|
end
|
107
112
|
|
108
113
|
it 'fails when invalid package specified' do
|
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.11.
|
4
|
+
version: 5.11.1
|
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: 2020-
|
12
|
+
date: 2020-04-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: simp-beaker-helpers
|
@@ -534,6 +534,8 @@ files:
|
|
534
534
|
- spec/lib/simp/files/componentinfo_spec/module_with_invalid_weekday_entry/metadata.json
|
535
535
|
- spec/lib/simp/files/componentinfo_spec/module_with_malformed_metadata/CHANGELOG
|
536
536
|
- spec/lib/simp/files/componentinfo_spec/module_with_malformed_metadata/metadata.json
|
537
|
+
- spec/lib/simp/files/componentinfo_spec/module_with_prerelease_dash_in_version/CHANGELOG
|
538
|
+
- spec/lib/simp/files/componentinfo_spec/module_with_prerelease_dash_in_version/metadata.json
|
537
539
|
- spec/lib/simp/files/componentinfo_spec/module_with_version_misordered_entries/CHANGELOG
|
538
540
|
- spec/lib/simp/files/componentinfo_spec/module_with_version_misordered_entries/metadata.json
|
539
541
|
- spec/lib/simp/files/componentinfo_spec/module_without_changelog/metadata.json
|
@@ -568,6 +570,7 @@ files:
|
|
568
570
|
- spec/lib/simp/files/testpackage-1-0.noarch.rpm
|
569
571
|
- spec/lib/simp/files/testpackage-dist.spec
|
570
572
|
- spec/lib/simp/files/testpackage-multi.spec
|
573
|
+
- spec/lib/simp/files/testpackage-rc0.spec
|
571
574
|
- spec/lib/simp/files/testpackage.spec
|
572
575
|
- spec/lib/simp/local_gpg_signing_key_spec.rb.beaker-only
|
573
576
|
- spec/lib/simp/packer/iso_vars_json_spec.rb
|