packaging_rake_tasks 1.3.3 → 1.4.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
  SHA1:
3
- metadata.gz: 7a8b976716792d14586a1f12b6831bb6789992d0
4
- data.tar.gz: 28e8ced16c95713c36c700e3a6ff231d88791377
3
+ metadata.gz: 555386f0f7665eb189bdd563691fd09a8a9c622f
4
+ data.tar.gz: c63a51eec0aeda4c59f9f2d88d80b1b9bec69cf9
5
5
  SHA512:
6
- metadata.gz: 0ec739105a8ddeb49785ecbdc4f417348b34013428be9e2f88b9baedf808b706480c428176cb8d610e6059eaf1dcbc27f7d7e117d40d18aa8a89a03df3212aab
7
- data.tar.gz: b4f65f38bbc7588ebdc0a60b72dfda0416d17f72c1e99d3a80405e38c16b140c2dc1a41783cb8b06ae4386d850b7d3b042b9552806d1b4cba160b4c358b5c97b
6
+ metadata.gz: fcb61088f84c237dd626a140a9a4bba46d1fbe6ed46f5e405f0e61a1400ed14f07b9a1cd20b1aa20eb48b506b8c33313939d80499566bc99bb330517d6c1875c
7
+ data.tar.gz: ffae4cdca6851ba356db68e8fba00182bef7ac4adbdc3c7e5d8cd26f07921fda98dea91ae84cd80542a84c11efe6d056b988827041d8c804d3f62ac06e537f54
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.3
1
+ 1.4.0
@@ -0,0 +1,61 @@
1
+ #--
2
+ # Yast rake
3
+ #
4
+ # Copyright (C) 2017 SUSE LLC
5
+ # This library is free software; you can redistribute it and/or modify
6
+ # it only under the terms of version 2.1 of the GNU Lesser General Public
7
+ # License as published by the Free Software Foundation.
8
+ #
9
+ # This library is distributed in the hope that it will be useful, but WITHOUT
10
+ # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
+ # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12
+ # details.
13
+ #
14
+ # You should have received a copy of the GNU Lesser General Public
15
+ # License along with this library; if not, write to the Free Software
16
+ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
+ #++
18
+
19
+ require "shellwords"
20
+ require "open3"
21
+
22
+ namespace :build_dependencies do
23
+ def buildrequires
24
+ buildrequires = []
25
+
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)
32
+
33
+ raise "Parsing #{spec_file} failed:\n#{stderr}" unless status.success?
34
+
35
+ buildrequires.concat(stdout.split("\n"))
36
+ end
37
+
38
+ # remove the duplicates and sort the packages for easier reading
39
+ buildrequires.uniq!
40
+ buildrequires.sort!
41
+
42
+ buildrequires
43
+ end
44
+
45
+ desc "Print the packages required for building"
46
+ task :list do
47
+ puts buildrequires.join(" ")
48
+ end
49
+
50
+ desc "Install the packages required for building"
51
+ task :install do
52
+ escaped_list = buildrequires.map { |b| Shellwords.escape(b) }.join(" ")
53
+
54
+ if escaped_list.empty?
55
+ puts "Nothing to install, *.spec file not found or no build dependencies defined"
56
+ else
57
+ cmd = "sudo zypper install #{escaped_list}"
58
+ sh(cmd)
59
+ end
60
+ end
61
+ end
@@ -44,7 +44,8 @@ namespace :check do
44
44
  end
45
45
 
46
46
  res = `ruby -c -w #{file}`
47
- puts "#{file}: #{res}" if verbose
47
+ res = res.lines.reject { |s| s == "Syntax OK\n" }.join ""
48
+ puts res unless res.empty?
48
49
  raise "Syntax error found in file '#{file}'" unless $?.exitstatus.zero?
49
50
  end
50
51
 
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.3.3
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josef Reidinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-13 00:00:00.000000000 Z
11
+ date: 2017-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -36,6 +36,7 @@ files:
36
36
  - lib/packaging.rb
37
37
  - lib/packaging/configuration.rb
38
38
  - lib/packaging/tasks.rb
39
+ - lib/tasks/build_dependencies.rake
39
40
  - lib/tasks/check_changelog.rake
40
41
  - lib/tasks/check_committed.rake
41
42
  - lib/tasks/check_doc.rake
@@ -65,9 +66,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
66
  version: '0'
66
67
  requirements: []
67
68
  rubyforge_project:
68
- rubygems_version: 2.4.5.2
69
+ rubygems_version: 2.2.5
69
70
  signing_key:
70
71
  specification_version: 4
71
72
  summary: Rake tasks providing tasks to package project in git and integration with
72
73
  build service
73
74
  test_files: []
75
+ has_rdoc: