simp-rake-helpers 5.14.0 → 5.15.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: 5dfb50582e2d9f05a5ea7ac039013727dadd80b6fc931bd1c7a35ef2f1a89400
4
- data.tar.gz: 5507ff633482b131f3beeeeee24166e8afeacdbc94987fde93a7c564e77d6d05
3
+ metadata.gz: 0fc850ad07208e9cca1afe63b9ad29253c8e6dc2310290ad7c168faedd9ad0a7
4
+ data.tar.gz: 3bd521f05c66567b3478e675603be5c75a9b8a0ad9561322e43ad725e22f1d15
5
5
  SHA512:
6
- metadata.gz: edf69ac817e38a9b4c7e32ab6352c96b612728fd85a7e8e1c247ed6ac47a6d9d84e92207ce7437e6aa1cc2743cfad5128a7f0d94832940a093d2042063482682
7
- data.tar.gz: d9a07c960cbfe946978d97a565ebe468a6f259c9486002db13f89c0a6aefea8422d68d14e5e9c523e8bc34ce4b4ce48fce5c42a8f4d9ad329b8c3cf4fdf30a07
6
+ metadata.gz: f74eabacff77b22d46a168a1890fc0af3b97910e9aba213f72385e8bc349a0be59316158f14799dfc24d4b949d9c0342678767ce772181a0e1e938723bdad185
7
+ data.tar.gz: 61e13e8c60a02fe50481f5d19437e3d1ae9936cb28313d8a9e0a4a74041e243f63891872982b6695fcb26ffa5629237cb2d26b6777f4caba45a158e6d68fe571
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 5.15.0 / 2022-06-03
2
+ - Added
3
+ - Users now have the ability to set version limits in the `dependencies.yaml`
4
+ file that will override those in the `metadata.json`
5
+
1
6
  ### 5.14.0 / 2022-05-14
2
7
  - Added
3
8
  - Run `implantisomd5` after the ISO has been created so that it can be
@@ -89,12 +89,40 @@ module Simp::Rake::Build::RpmDeps
89
89
  #
90
90
  # +requires_list+:: list of package this module should require
91
91
  # from the 'dependencies.yaml'
92
+ #
93
+ # * If the entry is an Array, the second value will be treated as the
94
+ # minimum version and the third as the maximum version
95
+ # * If you specify your own limiters, it will put them in place verbatim
96
+ # * Examples:
97
+ # * ['rpm-name', '1.2.3']
98
+ # * Requires rpm-name >= 1.2.3
99
+ # * ['rpm-name', '1.2.3', '2.0.0']
100
+ # * Requires rpm-name >= 1.2.3
101
+ # * Requires rpm-name < 2.0.0
102
+ # * ['rpm-name', '> 1.2.3', '<= 2.0.0']
103
+ # * Requires rpm-name > 1.2.3
104
+ # * Requires rpm-name <= 2.0.0
92
105
  # +module_metadata+:: Hash containing the contents of the
93
106
  # module's 'metadata.json' file
94
107
  def self.generate_custom_rpm_requires(requires_list, module_metadata)
95
108
  rpm_metadata_content = []
96
109
 
97
- requires_list.each do |pkg|
110
+ requires_list.each do |pkg_to_modify|
111
+ pkg = pkg_to_modify
112
+ min_version = nil
113
+ max_version = nil
114
+
115
+ pkg, min_version, max_version = pkg if pkg.is_a?(Array)
116
+
117
+ rpm_version_chars = ['<','>','=']
118
+
119
+ if min_version && rpm_version_chars.none? { |x| min_version.include?(x) }
120
+ min_version = ">= #{min_version}"
121
+ end
122
+ if max_version && rpm_version_chars.none? { |x| max_version.include?(x) }
123
+ max_version = "< #{max_version}"
124
+ end
125
+
98
126
  pkg_parts = pkg.split(%r(-|/))[-2..-1]
99
127
 
100
128
  # Need to cover all base cases
@@ -118,12 +146,18 @@ module Simp::Rake::Build::RpmDeps
118
146
  dep_version = dep_info.first['version_requirement']
119
147
  end
120
148
 
121
- begin
122
- rpm_metadata_content << get_version_requires(pkg, dep_version)
123
- rescue SIMPRpmDepVersionException
124
- err_msg = "Unable to parse #{short_names.first} dependency" +
125
- " version '#{dep_version}'"
126
- raise SIMPRpmDepException.new(err_msg)
149
+ # Use the version specified in the config file if it exists
150
+ if min_version || max_version
151
+ rpm_metadata_content << "Requires: #{pkg} #{min_version}" if min_version
152
+ rpm_metadata_content << "Requires: #{pkg} #{max_version}" if max_version
153
+ else
154
+ begin
155
+ rpm_metadata_content << get_version_requires(pkg, dep_version)
156
+ rescue SIMPRpmDepVersionException
157
+ err_msg = "Unable to parse #{short_names.first} dependency" +
158
+ " version '#{dep_version}'"
159
+ raise SIMPRpmDepException.new(err_msg)
160
+ end
127
161
  end
128
162
  end
129
163
  rpm_metadata_content.flatten
@@ -2,5 +2,5 @@ module Simp; end
2
2
  module Simp::Rake; end
3
3
 
4
4
  class Simp::Rake::Helpers
5
- VERSION = '5.14.0'
5
+ VERSION = '5.15.0'
6
6
  end
@@ -20,7 +20,7 @@
20
20
  # does NOT include puppetlabs/apt
21
21
  - 'pupmod-puppetlabs-stdlib'
22
22
  - 'pupmod-ceritsc-yum'
23
- - 'pupmod-richardc-datacat'
23
+ - ['pupmod-richardc-datacat', '1.2.3', '<=3.4.5']
24
24
  :release: '2017.0'
25
25
  :external_dependencies:
26
26
  'rubygem-puppetserver-toml':
@@ -105,8 +105,8 @@ Requires: pupmod-puppetlabs-stdlib >= 3.2.0
105
105
  Requires: pupmod-puppetlabs-stdlib < 5.0.0
106
106
  Requires: pupmod-ceritsc-yum >= 0.9.6
107
107
  Requires: pupmod-ceritsc-yum < 1.0.0
108
- Requires: pupmod-richardc-datacat >= 0.6.2
109
- Requires: pupmod-richardc-datacat < 1.0.0
108
+ Requires: pupmod-richardc-datacat >= 1.2.3
109
+ Requires: pupmod-richardc-datacat <=3.4.5
110
110
  Requires: rubygem-puppetserver-toml >= 0.1.2
111
111
  Requires: rubygem-puppetserver-blackslate >= 2.1.2.4-1
112
112
  Requires: rubygem-puppetserver-blackslate < 2.2.0.0
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.14.0
4
+ version: 5.15.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: 2022-05-27 00:00:00.000000000 Z
12
+ date: 2022-06-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: simp-beaker-helpers