Sha256: 756e9111959e66e409ab8e7a70e7da948f0b434d5885a92e977dda39bb8a8d2b
Contents?: true
Size: 784 Bytes
Versions: 15
Compression:
Stored size: 784 Bytes
Contents
#!/usr/bin/env ruby unless (rpm_cmd = ARGV[0]) STDERR.puts 'Usage: sign-rpm RPM_COMMAND' exit 1 end password = '<%= passphrase %>' 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 =~ /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 rescue Errno::EIO break end end end
Version data entries
15 entries across 15 versions & 1 rubygems