Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the rpm package signing to work with newer rpm version #892

Merged
merged 2 commits into from
Dec 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions resources/rpm/signing.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,22 @@ require 'pty'

puts rpm_cmd
PTY.spawn(rpm_cmd) do |r, w, pid|
# Older versions of rpmsign will prompt right away for the passphrase
prompt = r.read(19)

# match the expected prompt exactly, since that's the only way we know if
# something went wrong.
unless prompt == 'Enter pass phrase: '
STDERR.puts "unexpected output from `#{rpm_cmd}`: '#{prompt}'"
Process.kill(:KILL, pid)
exit 1
if prompt == 'Enter pass phrase: '
STDOUT.puts prompt
w.write("#{password}\n")
end

STDOUT.puts prompt
w.write("#{password}\n")

# Keep printing output unti the command exits
loop do
begin
line = r.gets
puts line
if (line =~ /failed/) && !(line =~ /warning:/)
if line =~ /Please enter the passphrase to unlock the OpenPGP secret key:/
w.write("#{password}\n")
elsif (line =~ /failed/) && !(line =~ /warning:/)
STDERR.puts 'RPM signing failure'
exit 1
end
Expand Down