os.putenv('LC_ALL', 'C')
args = ['--resign', '--define', '_signature gpg', '--define', '_gpg_name ' + sign_key] + files
child = pexpect.spawn('/bin/rpm', args)
- child.logfile = sys.stderr
+ child.logfile_read = sys.stderr
child.expect('Enter pass phrase:', timeout=30)
child.sendline(password)
- child.expect(pexpect.EOF)
+ child.expect(pexpect.EOF, timeout=None)
child.close()
rc = child.exitstatus
- #cmd = ['/bin/rpm', '--resign', '--define', '_signature gpg', '--define', '_gpg_name ' + sign_key] + files
- #rc = subprocess.call(cmd, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE, close_fds = True)
if rc != 0:
raise OSError, 'package signing failed'