packaging_rake_tasks 1.1.3 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/tasks/check_changelog.rake +46 -0
- data/lib/tasks/osc.rake +22 -10
- data/lib/tasks/package.rake +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 346137705217472517f434fc2743f4c4ebfc6bd6
|
4
|
+
data.tar.gz: e571834e78308e058423af5db92ae37e997da274
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 423b879d5094d09cdf941aafb1dc618bf8942fdda011d51830b8a5a66e9436fdf69a7ef3e25b29adcb9e8829f447cda4e3b466c4b2be8cb50ae575d586e96b6b
|
7
|
+
data.tar.gz: 3a2417498b9518c14538970e0cbe2d6f78f3b3a75882b665e2910ebcb0b1cc6fda31974371e64d8a128897ebb82394853cfc0b30dabf278d5388ceeebf6646c4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.4
|
@@ -0,0 +1,46 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
3
|
+
# This library is free software; you can redistribute it and/or modify
|
4
|
+
# it only under the terms of version 2.1 of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation.
|
6
|
+
#
|
7
|
+
# This library is distributed in the hope that it will be useful, but WITHOUT
|
8
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
9
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
10
|
+
# details.
|
11
|
+
#
|
12
|
+
# You should have received a copy of the GNU Lesser General Public
|
13
|
+
# License along with this library; if not, write to the Free Software
|
14
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
15
|
+
#++
|
16
|
+
|
17
|
+
require 'rake'
|
18
|
+
|
19
|
+
namespace "check" do
|
20
|
+
desc "Checking for new IDs (bugzilla,fate,...) in *.changes file"
|
21
|
+
task :changelog do
|
22
|
+
begin
|
23
|
+
checkout
|
24
|
+
copy_sources
|
25
|
+
|
26
|
+
puts "Checking IDs in *.changes file" if verbose
|
27
|
+
# Checking makes only sense if the version in the *.spec file has been changed
|
28
|
+
if version_changed?( "#{osc_checkout_dir}/#{package_name}.spec" )
|
29
|
+
Dir.chdir(osc_checkout_dir) do
|
30
|
+
# Tags described in https://github.com/openSUSE/osc-plugin-factory/blob/e12bc02e9817277335ce6adaa8e8d334d03fcc5d/check_tags_in_requests.py#L63
|
31
|
+
cmd = "osc -A '#{obs_api}' diff *.changes"
|
32
|
+
puts cmd if verbose
|
33
|
+
ret = `bash -c '#{cmd}'`
|
34
|
+
unless ret.match(/(bnc|fate|boo|bsc|bgo)#[0-9]+/i) || ret.match(/cve-[0-9]{4}-[0-9]+/i)
|
35
|
+
raise "Stopping, missing new bugzilla or fate entry in the *.changes file.\n"\
|
36
|
+
"e.g. bnc#<number>, fate#<number>, boo#<number>, bsc#<number>, bgo#<number>, cve-<number>"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
else
|
40
|
+
puts "=> do not check for IDs in *.changes file"
|
41
|
+
end
|
42
|
+
ensure
|
43
|
+
cleaning
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
data/lib/tasks/osc.rake
CHANGED
@@ -74,6 +74,26 @@ namespace :osc do
|
|
74
74
|
end
|
75
75
|
end
|
76
76
|
|
77
|
+
def version_changed? updated_spec_file
|
78
|
+
begin
|
79
|
+
file = Tempfile.new('yast-rake')
|
80
|
+
file.close
|
81
|
+
sh "osc -A '#{obs_api}' cat '#{obs_sr_project}' '#{package_name}' '#{package_name}.spec' > #{file.path}"
|
82
|
+
original_version = version_from_spec(file.path)
|
83
|
+
new_version = version_from_spec(updated_spec_file)
|
84
|
+
|
85
|
+
if new_version == original_version
|
86
|
+
puts "Version has not been changed in *.spec file" if verbose
|
87
|
+
return false
|
88
|
+
else
|
89
|
+
puts "Version has been changed in *.spec file" if verbose
|
90
|
+
return true
|
91
|
+
end
|
92
|
+
ensure
|
93
|
+
file.unlink if file
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
77
97
|
def version_from_spec spec_glob
|
78
98
|
version = `grep '^Version:' #{spec_glob}`
|
79
99
|
version.sub!(/^Version:\s*/, "")
|
@@ -189,21 +209,13 @@ namespace :osc do
|
|
189
209
|
task :sr => "osc:commit" do
|
190
210
|
begin
|
191
211
|
checkout
|
192
|
-
|
193
|
-
|
194
|
-
file.close
|
195
|
-
sh "osc -A '#{obs_api}' cat '#{obs_sr_project}' '#{package_name}' '#{package_name}.spec' > #{file.path}"
|
196
|
-
original_version = version_from_spec(file.path)
|
197
|
-
new_version = version_from_spec("#{package_dir}/#{package_name}.spec")
|
198
|
-
|
199
|
-
if new_version == original_version
|
200
|
-
puts "No version change => no submit request" if verbose
|
212
|
+
unless version_changed?( "#{package_dir}/#{package_name}.spec" )
|
213
|
+
puts "=> no submit request" if verbose
|
201
214
|
else
|
202
215
|
Rake::Task["osc:sr:force"].execute
|
203
216
|
end
|
204
217
|
ensure
|
205
218
|
cleaning
|
206
|
-
file.unlink if file
|
207
219
|
end
|
208
220
|
end
|
209
221
|
|
data/lib/tasks/package.rake
CHANGED
@@ -20,5 +20,5 @@ require 'rake'
|
|
20
20
|
|
21
21
|
desc 'Prepare sources for rpm build'
|
22
22
|
# just call the checks and then build the package
|
23
|
-
task :package => ["check:syntax", "check:committed", :test, :tarball]
|
23
|
+
task :package => ["check:syntax", "check:committed", "check:changelog", :test, :tarball]
|
24
24
|
|
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.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Reidinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-15 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/check_changelog.rake
|
39
40
|
- lib/tasks/check_committed.rake
|
40
41
|
- lib/tasks/check_license.rake
|
41
42
|
- lib/tasks/check_osc.rake
|
@@ -63,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
64
|
version: '0'
|
64
65
|
requirements: []
|
65
66
|
rubyforge_project:
|
66
|
-
rubygems_version: 2.
|
67
|
+
rubygems_version: 2.2.2
|
67
68
|
signing_key:
|
68
69
|
specification_version: 4
|
69
70
|
summary: Rake tasks providing tasks to package project in git and integration with
|