Skip to content

Commit

Permalink
Restore some of the previous behaviour that read the old rpmsign prompt
Browse files Browse the repository at this point in the history
Signed-off-by: DJ Mountney <david@twkie.net>
  • Loading branch information
twk3 committed Jun 15, 2019
1 parent 962b20e commit e15bdc5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion resources/rpm/signing.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@ 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)

if prompt == 'Enter pass phrase: '
STDOUT.puts prompt
w.write("#{password}\n")
end

# Keep printing output unti the command exits
loop do
begin
line = r.gets
puts line
if line =~ /Enter pass phrase:/ || line =~ /Please enter the passphrase to unlock the OpenPGP secret key:/
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'
Expand Down

0 comments on commit e15bdc5

Please sign in to comment.