simp-rake-helpers 5.2.0 → 5.3.0

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: 476fb45c0548c83de14eec268b1970b990a0c50ef8ead160f502bb3c34fa3bd6
4
- data.tar.gz: 0d6dde21abf6befaf136b973f324d2cd812f0d36d49c0a6e48971499b0487802
3
+ metadata.gz: cd72175666f147fd150435496fed0093586b507af569c4682afa713f12fb251f
4
+ data.tar.gz: 21b5c168ec65c56a9081d3b5a53d80f53fe96ec9b8e48b988c47f025d8476f29
5
5
  SHA512:
6
- metadata.gz: f090fd69b70d38e94f0a71ba57d3e76782b10a7ef6e7987c8a4b8665b17a29b2b5c9b7065c0b150979544f09203b8ac385fea194b2bf5672b44499868302a9e0
7
- data.tar.gz: 3671a8e5759091753650ca03fcddfbc68ada6c85fcb12e6c33e6d803e3b9c3d78eafbcf858ef828632ba085d9fe831abd3d4d124227e83afaf7a408c8f310a6c
6
+ metadata.gz: 50fc2bed131761ed25041f17ed4455bfe270d96d9c9e42e456ebf3ad870cf2cdb9c936af6ece47cbb98aea65d7ee9bc12429eab9e40f9c4017bcd396564ee68b
7
+ data.tar.gz: 08206ff2084e66f5544751d3bc6f9430437c6b2fee09d3df4665878d1c7dd97b847e075dc86eabe30f02189d0549b9acadab6bdede251c0996af4f4f46fdfdef
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ### 5.3.0 / 2018-02-02
2
+ * Add ability to specify external, non-module, RPM dependencies for
3
+ a checked-out repo from `simp-core/build/rpm/dependencies.yaml`
4
+
1
5
  ### 5.2.0 / 2017-12-20
2
6
  * Create pkg:create_tag_changelog, which is a more thorough version
3
7
  of Simp::Rake::Pupmod::Helpers changelog_annotation task.
@@ -119,6 +119,29 @@ module Simp::Rake::Build::RpmDeps
119
119
  rpm_metadata_content.flatten
120
120
  end
121
121
 
122
+ # Generate 'Requires' lines from each dependency specified in the
123
+ # ext_deps_list array
124
+ #
125
+ # returns array of strings, each of which is a 'Requires' line
126
+ # for use in an RPM spec file
127
+ #
128
+ # +ext_deps_list+:: Array of dependency Hashes. The key of each
129
+ # dependency Hash the name of the dependency package and its value
130
+ # is a Hash containing the version info. For example,
131
+ # [ 'package1' => { :min => '1.0.0' },
132
+ # 'package2' => { :min => '3.1-1', :max => '4.0' } ]
133
+ def self.generate_external_rpm_requires(ext_deps_list)
134
+ requires = []
135
+
136
+ ext_deps_list.each do |pkg_name, options|
137
+ requires << "Requires: #{pkg_name} >= #{options[:min]}"
138
+ if options[:max]
139
+ requires << "Requires: #{pkg_name} < #{options[:max]}"
140
+ end
141
+ end
142
+ requires
143
+ end
144
+
122
145
  # Generate 'Requires' lines from each dependency specified in the
123
146
  # module_metadata hash
124
147
  #
@@ -174,6 +197,8 @@ module Simp::Rake::Build::RpmDeps
174
197
  # * 'Requires' lines for any requires specified in the
175
198
  # module_rpm_meta hash, where the versions for those
176
199
  # dependencies are pulled from module_metadata.
200
+ # * 'Requires' line(s) for any external dependencies specified
201
+ # in the module_rpm_meta hash.
177
202
  #
178
203
  # Otherwise, the generated 'requires' file will contain
179
204
  # "Requires" lines for each dependency specified module_metadata.
@@ -200,6 +225,10 @@ module Simp::Rake::Build::RpmDeps
200
225
  rpm_metadata_content += generate_module_rpm_requires(module_metadata)
201
226
  end
202
227
 
228
+ if module_rpm_meta and module_rpm_meta[:external_dependencies]
229
+ rpm_metadata_content += generate_external_rpm_requires(module_rpm_meta[:external_dependencies])
230
+ end
231
+
203
232
  rpm_metadata_file = File.join(dir, 'build', 'rpm_metadata', 'requires')
204
233
 
205
234
  unless rpm_requires_up_to_date?(rpm_metadata_content, rpm_metadata_file)
@@ -2,5 +2,5 @@ module Simp; end
2
2
  module Simp::Rake; end
3
3
 
4
4
  class Simp::Rake::Helpers
5
- VERSION = '5.2.0'
5
+ VERSION = '5.3.0'
6
6
  end
@@ -22,6 +22,12 @@
22
22
  - 'pupmod-ceritsc-yum'
23
23
  - 'pupmod-richardc-datacat'
24
24
  :release: '2017.0'
25
+ :external_dependencies:
26
+ 'rubygem-puppetserver-toml':
27
+ :min: '0.1.2'
28
+ 'rubygem-puppetserver-blackslate':
29
+ :min: '2.1.2.4-1'
30
+ :max: '2.2.0.0'
25
31
  'release_only_mod':
26
32
  :release: '2017.2'
27
33
  'obsoletes_too_new_mod':
@@ -1,5 +1,6 @@
1
1
  require 'simp/rake/build/rpmdeps'
2
2
  require 'spec_helper'
3
+ require 'tmpdir'
3
4
  require 'yaml'
4
5
 
5
6
  describe 'Simp::Rake::Build::RpmDeps#get_version_requires' do
@@ -81,7 +82,7 @@ EOM
81
82
  end
82
83
  end
83
84
 
84
- context 'managed component with a subset of metadata.json dependencies and a release' do
85
+ context 'managed component with a subset of metadata.json deps, external deps and a release' do
85
86
  it 'should generate both a requires file and a release file from dependencies.yaml' do
86
87
  mod_dir = File.join(@tmp_dir, 'files', 'managed_mod')
87
88
  Simp::Rake::Build::RpmDeps::generate_rpm_meta_files(mod_dir, rpm_metadata)
@@ -97,6 +98,9 @@ Requires: pupmod-ceritsc-yum >= 0.9.6
97
98
  Requires: pupmod-ceritsc-yum < 1.0.0
98
99
  Requires: pupmod-richardc-datacat >= 0.6.2
99
100
  Requires: pupmod-richardc-datacat < 1.0.0
101
+ Requires: rubygem-puppetserver-toml >= 0.1.2
102
+ Requires: rubygem-puppetserver-blackslate >= 2.1.2.4-1
103
+ Requires: rubygem-puppetserver-blackslate < 2.2.0.0
100
104
  EOM
101
105
  actual = IO.read(requires_file)
102
106
  expect(actual).to eq expected
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.2.0
4
+ version: 5.3.0
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: 2017-12-20 00:00:00.000000000 Z
12
+ date: 2018-02-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -608,7 +608,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
608
608
  version: '0'
609
609
  requirements: []
610
610
  rubyforge_project:
611
- rubygems_version: 2.7.3
611
+ rubygems_version: 2.7.6
612
612
  signing_key:
613
613
  specification_version: 4
614
614
  summary: SIMP rake helpers