packaging_rake_tasks 1.5.0 → 1.5.3

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: 46ce3829c7375bbaa7fbae51f8dd2d048a5405f02b79a9847c2896e64b4b0bd3
4
- data.tar.gz: 1f7d203a058da0ff9fc95bf4d76fa6e514bd1878801dc70963a12960b77f4d87
3
+ metadata.gz: b51c3cd7c0620ced6018b4efe708293083eec2426b21aa1eac2475f3a6375ecd
4
+ data.tar.gz: fbf59488ffb0527701ab74c2ef0e9774d7eccac73de402c846abf4fc8b4c8057
5
5
  SHA512:
6
- metadata.gz: 83865577aedef1a4a9e02111e73b326db1f9a69040434b8ddbac38736fccfad1b54507f1fb84c1f8927e158b22fcf37e1be8f1aff024ee1fd5433e30dcac5f5c
7
- data.tar.gz: cb5ddfdacab8e31f46e899b77941a9a295b140343d37bfd12c850ea72996368e9c2e6260b072de829773b048a7418960928011c38955ce876302e413482a6308
6
+ metadata.gz: ff56da780a5b28abc3e2722f414f7f9141f7c9a29d7c73eb631c3113d8c1301a8463c1be80a52f11d7e07ae8535e1a289a514473ff6ac894d66f2cb8968d8bab
7
+ data.tar.gz: 13215646f023675f0157fce2e8cec42c97cd1d3c56c00773f824b17d5ff2a2321926323a4d481ec48ceaca893a50d6dc0e04c7152e637b10ac4e39f9dd43f2bc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.0
1
+ 1.5.3
@@ -20,19 +20,46 @@ require "shellwords"
20
20
  require "open3"
21
21
 
22
22
  namespace :build_dependencies do
23
- def buildrequires
24
- buildrequires = []
23
+ # Read the multi build targets from the "_multibuild" file.
24
+ # @return [Array<String>] list of multi build targets or empty Array if the
25
+ # "_multibuild" file does not exist
26
+ def multibuild_flavors
27
+ flavors = []
25
28
 
26
- config = Packaging::Configuration.instance
27
- Dir.glob("#{config.package_dir}/*.spec").each do |spec_file|
28
- # get the BuildRequires from the spec files, this also expands the RPM macros like %{rubygem}
29
- # use Open3 as the command produces some bogus error messages on stderr even on success,
30
- # but in case of error it provides a hint what failed
31
- stdout, stderr, status = Open3.capture3("rpmspec", "-q", "--buildrequires", spec_file)
29
+ # parse the _multibuild XML file if it is present
30
+ mbfile = File.join(Packaging::Configuration.instance.package_dir, "_multibuild")
31
+ if File.exist?(mbfile)
32
+ require "rexml/document"
33
+ doc = REXML::Document.new(File.read(mbfile))
34
+ doc.elements.each("//multibuild/flavor | //multibuild/package") do |node|
35
+ flavors << node.text.strip
36
+ end
37
+ end
32
38
 
33
- raise "Parsing #{spec_file} failed:\n#{stderr}" unless status.success?
39
+ puts "Found multibuild targets: #{flavors.join(", ")}" if verbose
40
+ flavors
41
+ end
42
+
43
+ # Read the build dependencies from all spec files. For multi build packages
44
+ # evaluate all package flavors.
45
+ # @return [Array<String>] list of build dependencies
46
+ def buildrequires
47
+ buildrequires = []
48
+ # OBS additionally runs a default build with empty flavor in multi build packages,
49
+ # for simplification use it also for single build packages
50
+ flavors = multibuild_flavors + [ "" ]
51
+ Dir.glob("#{Packaging::Configuration.instance.package_dir}/*.spec").each do |spec_file|
52
+ # replace the "@BUILD_FLAVOR@" placeholder by each flavor defined
53
+ flavors.each do |flavor|
54
+ spec_content = File.read(spec_file).gsub("@BUILD_FLAVOR@", flavor)
34
55
 
35
- buildrequires.concat(stdout.split("\n"))
56
+ # get the BuildRequires from the spec files, this also expands the RPM macros like %{rubygem}
57
+ # use Open3 as the command produces some bogus error messages on stderr even on success,
58
+ # but in case of error it provides a hint what failed
59
+ stdout, stderr, status = Open3.capture3("rpmspec", "-q", "--buildrequires", "/dev/stdin", stdin_data: spec_content)
60
+ raise "Parsing #{spec_file} (flavor #{flavor.inspect})failed:\n#{stderr}" unless status.success?
61
+ buildrequires.concat(stdout.split("\n"))
62
+ end
36
63
  end
37
64
 
38
65
  # remove the duplicates and sort the packages for easier reading
data/lib/tasks/osc.rake CHANGED
@@ -160,8 +160,12 @@ namespace :osc do
160
160
  Dir.chdir osc_checkout_dir do
161
161
  puts "building package..." if verbose
162
162
 
163
- # pipe yes to osc build to automatic rebuild broken build root if it happen
164
- command = "yes | osc -A '#{obs_api}' build"
163
+ # feed the "osc build" command with "y" input to automatically rebuild
164
+ # the broken build root if that happens, three attempts should be enough in most cases
165
+ # do not use the "yes" command here as the endless output might cause endless loop
166
+ # (workaround for a broken rpmlint/checkbashisms test,
167
+ # https://bugzilla.suse.com/show_bug.cgi?id=1190094)
168
+ command = "echo -e 'y\\ny\\ny\\n' | osc -A '#{obs_api}' build"
165
169
  command << " --no-verify" #ignore untrusted BS projects
166
170
  command << " --release=1" #have always same release number
167
171
  # store packages for given base system at one place, so it speeds up rebuild
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: packaging_rake_tasks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Reidinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-25 00:00:00.000000000 Z
11
+ date: 2023-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -49,7 +49,7 @@ files:
49
49
  - lib/tasks/tarball.rake
50
50
  homepage: https://github.com/openSUSE/packaging_rake_tasks
51
51
  licenses:
52
- - LGPL v2.1
52
+ - LGPL-2.1
53
53
  metadata: {}
54
54
  post_install_message:
55
55
  rdoc_options: []
@@ -67,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  version: '0'
68
68
  requirements: []
69
69
  rubyforge_project:
70
- rubygems_version: 2.7.6.2
70
+ rubygems_version: 2.7.6.3
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: Rake tasks providing tasks to package project in git and integration with