simp-rake-helpers 1.0.10 → 1.0.11
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/CHANGELOG.md +8 -0
- data/lib/simp/rake/helpers.rb +1 -1
- data/lib/simp/rpm.rb +53 -20
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d12b61c9cbf1d5f9143d3fe5d6af7f38019023e
|
4
|
+
data.tar.gz: e73156476af4b7deacd26a04daa067796125c21c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 428b0d6fda5038f7ca0b8d01afbce8cebfbd0fd246b7f98c35cbfb2d3b01246ac1ca9d8fa727e493ab2a2f30a2b136281d6122502e869939e1b9a3b9eb513f1d
|
7
|
+
data.tar.gz: b37f3e18f80764b7554c6aea51e0ea4e7aaba993bf464272ac3d9129e7842ae9ad6712eb8e2e05e4019f41635c41eff82d4dd238db34dca6ac1cfc1e68dc41c3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
### 1.0.11 / 2015-07-30
|
2
|
+
* Allow simp/rpm to be used independently of Rake
|
3
|
+
* Ensure that packages are not re-signed that have already been signed by the
|
4
|
+
presented key.
|
5
|
+
* Worked around an issue where rpm --resign will prompt more than once for the
|
6
|
+
GPG key using the latest GPG version. This happens on the command line as
|
7
|
+
well.
|
8
|
+
|
1
9
|
### 1.0.10 / 2015-07-23
|
2
10
|
* Relax dependency to allow puppet 3 or above
|
3
11
|
|
data/lib/simp/rake/helpers.rb
CHANGED
data/lib/simp/rpm.rb
CHANGED
@@ -133,35 +133,68 @@ module Simp
|
|
133
133
|
end
|
134
134
|
end
|
135
135
|
|
136
|
-
|
136
|
+
gpg_key_size = nil
|
137
|
+
gpg_key_id = nil
|
138
|
+
%x(gpg --homedir=#{keydir} --list-keys #{gpg_name} 2>&1).each_line do |line|
|
139
|
+
head,data = line.split(/\s+/)
|
140
|
+
if head == 'pub'
|
141
|
+
gpg_key_size,gpg_key_id = data.split('/')
|
142
|
+
break
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
if !gpg_key_size || !gpg_key_id
|
147
|
+
fail("Error getting GPG Key metadata")
|
148
|
+
end
|
149
|
+
|
150
|
+
@@gpg_keys[gpg_key] = {
|
151
|
+
:dir => keydir,
|
152
|
+
:name => gpg_name,
|
153
|
+
:key_id => gpg_key_id,
|
154
|
+
:key_size => gpg_key_size,
|
155
|
+
:password => gpg_password
|
156
|
+
}
|
137
157
|
end
|
138
158
|
|
139
159
|
# Signs the given RPM with the given gpg_key (see Simp::RPM.load_key for
|
140
160
|
# details on the value of this parameter).
|
141
161
|
def self.signrpm(rpm, gpg_key)
|
142
162
|
gpgkey = load_key(gpg_key)
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
163
|
+
|
164
|
+
gpg_sig = nil
|
165
|
+
%x(rpm -Kv #{rpm}).each_line do |line|
|
166
|
+
if line =~ /key\sID\s(.*):/
|
167
|
+
gpg_sig = $1.strip
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
unless gpg_sig == gpgkey[:key_id]
|
172
|
+
signcommand = "rpm " +
|
173
|
+
"--define '%_signature gpg' " +
|
174
|
+
"--define '%__gpg %{_bindir}/gpg' " +
|
175
|
+
"--define '%_gpg_name #{gpgkey[:name]}' " +
|
176
|
+
"--define '%_gpg_path #{gpgkey[:dir]}' " +
|
177
|
+
"--resign #{rpm}"
|
178
|
+
begin
|
179
|
+
PTY.spawn(signcommand) do |read, write, pid|
|
180
|
+
begin
|
181
|
+
while !read.eof? do
|
182
|
+
read.expect(/pass\s?phrase:.*/) do |text|
|
183
|
+
write.puts(gpgkey[:password])
|
184
|
+
write.flush
|
185
|
+
end
|
186
|
+
end
|
187
|
+
rescue Errno::EIO
|
188
|
+
# This ALWAYS happens in Ruby 1.8.
|
154
189
|
end
|
155
|
-
|
156
|
-
# This ALWAYS happens in Ruby 1.8.
|
190
|
+
Process.wait(pid)
|
157
191
|
end
|
158
|
-
|
192
|
+
|
193
|
+
raise "Failure running #{signcommand}" unless $?.success?
|
194
|
+
rescue Exception => e
|
195
|
+
puts "Error occured while attempting to sign #{rpm}, skipping."
|
196
|
+
puts e
|
159
197
|
end
|
160
|
-
|
161
|
-
raise "Failure running #{signcommand}" unless $?.success?
|
162
|
-
rescue Exception => e
|
163
|
-
puts "Error occured while attempting to sign #{rpm}, skipping."
|
164
|
-
puts e
|
165
198
|
end
|
166
199
|
end
|
167
200
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simp-rake-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Tessmer
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-07-
|
12
|
+
date: 2015-07-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|