]> git.pld-linux.org Git - projects/pld-ftp-admin.git/commitdiff
Ignore gpg passphrase prompt timeout, rpm now uses gpg-agent
authorJan Rękorajski <baggins@pld-linux.org>
Sun, 28 Feb 2021 18:30:48 +0000 (19:30 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Sun, 28 Feb 2021 18:30:48 +0000 (19:30 +0100)
modules/sign.py

index f1f82e8c4b370efefcf7733bcce64ecf05c748c8..dc5cc4fac964a25fd66e362251a6a8d829b60c5e 100644 (file)
@@ -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
This page took 0.133944 seconds and 4 git commands to generate.