diff options
author | Jan Rękorajski | 2021-02-28 18:30:48 (GMT) |
---|---|---|
committer | Jan Rękorajski | 2021-02-28 18:30:48 (GMT) |
commit | 89ac3e3745b3fdb596656adba1f1a4d983b86055 (patch) | |
tree | 28d5e0bbd5a02611aea836c63a9f264e3ccc3151 | |
parent | 4794304ab83ff97f50205c825e5d9c4b1da1915e (diff) | |
download | pld-ftp-admin-89ac3e3745b3fdb596656adba1f1a4d983b86055.zip pld-ftp-admin-89ac3e3745b3fdb596656adba1f1a4d983b86055.tar.gz |
Ignore gpg passphrase prompt timeout, rpm now uses gpg-agent
-rw-r--r-- | modules/sign.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/sign.py b/modules/sign.py index f1f82e8..dc5cc4f 100644 --- a/modules/sign.py +++ b/modules/sign.py @@ -48,8 +48,12 @@ def signpkgs(files, password): args = ['--resign', '--define', '_signature gpg', '--define', '_gpg_name ' + sign_key] + files child = pexpect.spawn('/bin/rpm', args, encoding='utf-8') child.logfile_read = sys.stderr - child.expect(u'Enter pass phrase:', timeout=30) - child.sendline(password) + # TODO: we need a smarter way to figuring out if rpm already stored password in gpg-agent + try: + child.expect(u'Enter pass phrase:', timeout=30) + child.sendline(password) + except pexpect.exceptions.TIMEOUT: + print('WARN: rpm did not ask for password', file=sys.stderr) child.expect(pexpect.EOF, timeout=None) child.close() rc = child.exitstatus |