packaging 0.113.0 → 0.115.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: 38a695c2a203545ed683903f02ae7fa8c5061c4cc2f9df51b51421527e479873
4
- data.tar.gz: 9efef213c86d137b864401c7bc51d96c242c4bba6f8086652b727f325588ecd1
3
+ metadata.gz: 369be5ff2b204e9d0982da001c49688c08fedf383e91157dcb7285be5af1740f
4
+ data.tar.gz: af6c7ab5542d0dedbfee18645bba699ee9bcc2fc8563b970c00461c56b216500
5
5
  SHA512:
6
- metadata.gz: f1ecea7327e7f846700180f7f80a3f07baad08ae1b432261ba3b500438fd8232af5b676b6593905f6dc8117b4e6c84d7523fec06a915128297b1bb60b992d98e
7
- data.tar.gz: b078ed636dbd2b8aa327c1a1784fa463d5c9aebf3ea5bc48c0fa9aafc015bfdee698d64544bbe7974b745219972224444f0413feb6cfcf59aadcd8f534216073
6
+ metadata.gz: 640dbd3c34a6c2abbd550b732a15148957755c9c5b0211ab7d2b459489af92ae12051e479fc8d48c0844956883d663eb7c2f773bed529578d983d2ab3ae0f484
7
+ data.tar.gz: efc90b7c5185f406bd0bc6f7cdceb85456c1bb1d403fbbf705e2351a320af91f908cd3271f58c1d5a8f1629ae588918cbe2b806145e750204e22ee6fcd3625dc
@@ -109,6 +109,14 @@ module Pkg
109
109
  signature_format: 'v4',
110
110
  repo: true,
111
111
  },
112
+ '38' => {
113
+ architectures: ['x86_64'],
114
+ source_architecture: 'SRPMS',
115
+ package_format: 'rpm',
116
+ source_package_formats: ['src.rpm'],
117
+ signature_format: 'v4',
118
+ repo: true,
119
+ },
112
120
  },
113
121
 
114
122
  'osx' => {
@@ -154,6 +162,14 @@ module Pkg
154
162
  },
155
163
 
156
164
  'sles' => {
165
+ '11' => {
166
+ architectures: ['x86_64'],
167
+ source_architecture: 'SRPMS',
168
+ package_format: 'rpm',
169
+ source_package_formats: ['src.rpm'],
170
+ signature_format: 'v3',
171
+ repo: true,
172
+ },
157
173
  '12' => {
158
174
  architectures: ['x86_64', 'ppc64le'],
159
175
  source_architecture: 'SRPMS',
@@ -40,7 +40,25 @@ module Pkg::Rpm::Repo
40
40
  end
41
41
  end
42
42
 
43
+ ##
44
+ ## Let a wrapper script handle lock setting and pathing for the createrepo command
45
+ ##
43
46
  def repo_creation_command(repo_directory, artifact_paths = nil)
47
+ artifact_paths_argument = if artifact_paths
48
+ artifact_paths.join(' ')
49
+ else
50
+ ''
51
+ end
52
+ "/usr/local/bin/packaging-createrepo-wrapper #{repo_directory} #{artifact_paths_argument}"
53
+ end
54
+
55
+
56
+ ##
57
+ ## Deprecated
58
+ ## This was a slightly tortous way of going about this. Instead, see above.
59
+ ## Instead of constructing loop, let a wrapper script handle the details.
60
+ ##
61
+ def deprecated_repo_creation_command(repo_directory, artifact_paths = nil)
44
62
  cmd = "[ -d #{repo_directory} ] || exit 1 ; "
45
63
  cmd << "pushd #{repo_directory} > /dev/null && "
46
64
  cmd << 'echo "Checking for running repo creation. Will wait if detected." && '
@@ -131,14 +149,19 @@ module Pkg::Rpm::Repo
131
149
  end
132
150
 
133
151
  def retrieve_repo_configs(target = "repo_configs")
134
- wget = Pkg::Util::Tool.check_tool("wget")
152
+ wget = Pkg::Util::Tool.check_tool('wget')
135
153
  FileUtils.mkdir_p("pkg/#{target}")
136
154
  config_url = "#{base_url}/#{target}/rpm/"
155
+
156
+ config_fetch_command = <<~CONFIG_FETCH_COMMAND.gsub(%r{\n}, ' ')
157
+ #{wget} --recursive --no-parent --no-host-directories --cut-dirs=3
158
+ "--directory-prefix=pkg/#{target} --reject='index' #{config_url}"
159
+ CONFIG_FETCH_COMMAND
160
+
137
161
  begin
138
- stdout, = Pkg::Util::Execution.capture3("#{wget} -r -np -nH --cut-dirs 3 -P pkg/#{target} --reject 'index*' #{config_url}")
139
- stdout
162
+ Pkg::Util::Execution.capture3(config_fetch_command)[0]
140
163
  rescue StandardError => e
141
- fail "Couldn't retrieve rpm yum repo configs.\n#{e}"
164
+ fail "\"#{config_fetch_command} failed.\n#{e}"
142
165
  end
143
166
  end
144
167
 
@@ -152,27 +175,21 @@ module Pkg::Rpm::Repo
152
175
  def generate_repo_configs(source = "repos", target = "repo_configs", signed = false)
153
176
  # We have a hard requirement on wget because of all the download magicks
154
177
  # we have to do
155
- #
156
178
  wget = Pkg::Util::Tool.check_tool("wget")
157
179
 
158
180
  # This is the standard path to all build artifacts on the distribution
159
181
  # server for this commit
160
- #
161
182
  repo_base = "#{base_url}/#{source}/"
162
183
 
163
- # First check if the artifacts directory exists
164
- #
165
-
166
184
  # We have to do two checks here - first that there are directories with
167
185
  # repodata folders in them, and second that those same directories also
168
186
  # contain rpms
169
- #
170
187
  stdout, = Pkg::Util::Execution.capture3("#{wget} --spider -r -l 5 --no-parent #{repo_base} 2>&1")
171
- stdout = stdout.split.uniq.reject { |x| x =~ /\?|index/ }.select { |x| x =~ /http:.*repodata\/$/ }
188
+ stdout = stdout.split.uniq.reject { |x| x =~ /\?|index/ }
189
+ .select { |x| x =~ /http:.*repodata\/$/ }
172
190
 
173
191
  # RPMs will always exist at the same directory level as the repodata
174
192
  # folder, which means if we go up a level we should find rpms
175
- #
176
193
  yum_repos = []
177
194
  stdout.map { |x| x.chomp('repodata/') }.each do |url|
178
195
  output, = Pkg::Util::Execution.capture3("#{wget} --spider -r -l 1 --no-parent #{url} 2>&1")
@@ -98,10 +98,10 @@ describe 'Pkg::Rpm::Repo' do
98
98
  expect(FileUtils).to receive(:mkdir_p).with('pkg/repo_configs').and_return(true)
99
99
  expect(Pkg::Util::Execution)
100
100
  .to receive(:capture3)
101
- .with("#{wget} -r -np -nH --cut-dirs 3 -P pkg/repo_configs --reject 'index*' #{base_url}/repo_configs/rpm/")
101
+ .with(%r{#{wget}.*/repo_configs/rpm})
102
102
  .and_raise(RuntimeError)
103
103
  expect { Pkg::Rpm::Repo.retrieve_repo_configs }
104
- .to raise_error(RuntimeError, /Couldn't retrieve rpm yum repo configs/)
104
+ .to raise_error(RuntimeError, %r{failed\.$})
105
105
  end
106
106
  end
107
107
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.113.0
4
+ version: 0.115.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet By Perforce
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-08 00:00:00.000000000 Z
11
+ date: 2024-02-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug
@@ -307,28 +307,28 @@ signing_key:
307
307
  specification_version: 4
308
308
  summary: Puppet by Perforce packaging automation
309
309
  test_files:
310
- - spec/lib/packaging_spec.rb
311
- - spec/lib/packaging/sign_spec.rb
312
310
  - spec/lib/packaging/gem_spec.rb
313
- - spec/lib/packaging/deb/repo_spec.rb
314
- - spec/lib/packaging/artifactory_spec.rb
315
311
  - spec/lib/packaging/tar_spec.rb
316
- - spec/lib/packaging/deb_spec.rb
317
- - spec/lib/packaging/retrieve_spec.rb
318
- - spec/lib/packaging/config_spec.rb
319
312
  - spec/lib/packaging/platforms_spec.rb
320
- - spec/lib/packaging/paths_spec.rb
313
+ - spec/lib/packaging/retrieve_spec.rb
321
314
  - spec/lib/packaging/rpm/repo_spec.rb
322
- - spec/lib/packaging/repo_spec.rb
323
- - spec/lib/packaging/util/execution_spec.rb
324
- - spec/lib/packaging/util/rake_utils_spec.rb
315
+ - spec/lib/packaging/artifactory_spec.rb
316
+ - spec/lib/packaging/deb/repo_spec.rb
317
+ - spec/lib/packaging/sign_spec.rb
318
+ - spec/lib/packaging/paths_spec.rb
319
+ - spec/lib/packaging/util/ship_spec.rb
325
320
  - spec/lib/packaging/util/jenkins_spec.rb
321
+ - spec/lib/packaging/util/git_tag_spec.rb
322
+ - spec/lib/packaging/util/gpg_spec.rb
323
+ - spec/lib/packaging/util/rake_utils_spec.rb
324
+ - spec/lib/packaging/util/net_spec.rb
326
325
  - spec/lib/packaging/util/os_spec.rb
326
+ - spec/lib/packaging/util/execution_spec.rb
327
327
  - spec/lib/packaging/util/misc_spec.rb
328
- - spec/lib/packaging/util/net_spec.rb
329
- - spec/lib/packaging/util/git_spec.rb
330
- - spec/lib/packaging/util/ship_spec.rb
331
328
  - spec/lib/packaging/util/file_spec.rb
332
329
  - spec/lib/packaging/util/version_spec.rb
333
- - spec/lib/packaging/util/git_tag_spec.rb
334
- - spec/lib/packaging/util/gpg_spec.rb
330
+ - spec/lib/packaging/util/git_spec.rb
331
+ - spec/lib/packaging/config_spec.rb
332
+ - spec/lib/packaging/deb_spec.rb
333
+ - spec/lib/packaging/repo_spec.rb
334
+ - spec/lib/packaging_spec.rb