packaging 0.114.0 → 0.116.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: 872132e3dcf2718b739c196a7c91f520592fb6888139d95ac69ff851de817d3c
4
- data.tar.gz: fcc2351b89fb1c6bce455cb3ae93d8b3b372d3e70875eeda8d442e485d8332b5
3
+ metadata.gz: bb125c91f5926ab20605e4c9fb9ede2e46eb2494642ec25e37099327ad4a61f7
4
+ data.tar.gz: 89ab12e77f021ce246fbca1686b9f7218b059c660f557a56a1006623901cab10
5
5
  SHA512:
6
- metadata.gz: 15fd7bc9ac1134f59a6c28c0e6ce1a151b56ab3f9e35b971d847b3eed1f9f9e80b1dbe35c0de03e2e2919d06b4e7a5dc03817db5783aa482aa7439a17b8ba449
7
- data.tar.gz: 8edaf1970e42b5ed438b3c999b8f2fd57b9a6aae183e722cdb3670c6ec69bb3ae89a1a8cd2fd8bde4812be80441ed16d205f670337fa5ccd22a2010166f50117
6
+ metadata.gz: b938753dcaa851a1091496734b0b53a101b3b28f5d66fa7c2ded2f3ba23907d3c6ba2ab75b50f1c9a5f3c8f6b7f242c5235cd07e5fd651165c3791e63749fe97
7
+ data.tar.gz: 404cee80c9f4ab2f28d5cd311c8be29a929b42ba6c7c635d99853e77b6a4bf5df08712a0657369dd8587680ba40363d66d03cd672cd78a32ab4ae6bab31c5311
@@ -158,6 +158,14 @@ module Pkg
158
158
  source_package_formats: ['src.rpm'],
159
159
  signature_format: 'v3',
160
160
  repo: true,
161
+ },
162
+ '9' => {
163
+ architectures: ['x86_64'],
164
+ source_architecture: 'SRPMS',
165
+ package_format: 'rpm',
166
+ source_package_formats: ['src.rpm'],
167
+ signature_format: 'v4',
168
+ repo: true,
161
169
  }
162
170
  },
163
171
 
@@ -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")
@@ -393,7 +393,8 @@ module Pkg::Util::Net
393
393
  rvm_ruby_version = ENV['RVM_RUBY_VERSION'] || '3.1.1'
394
394
  export_packaging_location = "export PACKAGING_LOCATION='#{ENV['PACKAGING_LOCATION']}';" if ENV['PACKAGING_LOCATION'] && !ENV['PACKAGING_LOCATION'].empty?
395
395
  export_vanagon_location = "export VANAGON_LOCATION='#{ENV['VANAGON_LOCATION']}';" if ENV['VANAGON_LOCATION'] && !ENV['VANAGON_LOCATION'].empty?
396
- "source /usr/local/rvm/scripts/rvm; rvm use ruby-#{rvm_ruby_version}; #{export_packaging_location} #{export_vanagon_location} bundle install --path .bundle/gems ;"
396
+ export_gem_source = "export GEM_SOURCE='#{ENV['GEM_SOURCE']}';" if ENV['GEM_SOURCE'] && !ENV['GEM_SOURCE'].empty?
397
+ "source /usr/local/rvm/scripts/rvm; rvm use ruby-#{rvm_ruby_version}; #{export_gem_source} #{export_packaging_location} #{export_vanagon_location} bundle install --path .bundle/gems ;"
397
398
  end
398
399
 
399
400
  # Given a BuildInstance object and a host, send its params to the host. Return
@@ -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.114.0
4
+ version: 0.116.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-02-07 00:00:00.000000000 Z
11
+ date: 2024-02-29 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/config_spec.rb
311
- - spec/lib/packaging/repo_spec.rb
312
- - spec/lib/packaging/deb_spec.rb
313
- - spec/lib/packaging/util/gpg_spec.rb
310
+ - spec/lib/packaging/gem_spec.rb
311
+ - spec/lib/packaging/tar_spec.rb
312
+ - spec/lib/packaging/platforms_spec.rb
313
+ - spec/lib/packaging/retrieve_spec.rb
314
+ - spec/lib/packaging/rpm/repo_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
314
319
  - spec/lib/packaging/util/ship_spec.rb
315
- - spec/lib/packaging/util/os_spec.rb
316
- - spec/lib/packaging/util/git_spec.rb
317
- - spec/lib/packaging/util/git_tag_spec.rb
318
320
  - spec/lib/packaging/util/jenkins_spec.rb
319
- - spec/lib/packaging/util/net_spec.rb
321
+ - spec/lib/packaging/util/git_tag_spec.rb
322
+ - spec/lib/packaging/util/gpg_spec.rb
320
323
  - spec/lib/packaging/util/rake_utils_spec.rb
324
+ - spec/lib/packaging/util/net_spec.rb
325
+ - spec/lib/packaging/util/os_spec.rb
321
326
  - spec/lib/packaging/util/execution_spec.rb
322
327
  - spec/lib/packaging/util/misc_spec.rb
323
328
  - spec/lib/packaging/util/file_spec.rb
324
329
  - spec/lib/packaging/util/version_spec.rb
325
- - spec/lib/packaging/gem_spec.rb
326
- - spec/lib/packaging/deb/repo_spec.rb
327
- - spec/lib/packaging/retrieve_spec.rb
328
- - spec/lib/packaging/paths_spec.rb
329
- - spec/lib/packaging/platforms_spec.rb
330
- - spec/lib/packaging/tar_spec.rb
331
- - spec/lib/packaging/sign_spec.rb
332
- - spec/lib/packaging/artifactory_spec.rb
333
- - spec/lib/packaging/rpm/repo_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
334
  - spec/lib/packaging_spec.rb