[elbe-devel] [PATCH v4] repomanager: fix key unlock for existing repo

Torben Hohn torben.hohn at linutronix.de
Tue Apr 30 10:56:08 CEST 2019


From: Manuel Traut <manut at linutronix.de>

the gnupg key should be unlocked by the repomanager constructor.
However "elbe prjrepo upload_pkg" fails with the following error:

--8<--
running cmd +reprepro --basedir
"/var/cache/elbe/e9c6c678-669b-4d6c-b822-d432e62a78ea/repo" export jessie+
------------------------------------------------------------------------------
gpgme gave error Pinentry:32870:  Inappropriate ioctl for device
ERROR: Could not finish exporting 'jessie'!
There have been errors!
------------------------------------------------------------------------------
Command failed with errorcode 251
--8<--

This is because the SignWith line in reprepos distribution configuration
was not parsed correctly, and keyid containes the trailing newline.

Fix it by using split() without parameter, which splits the string at all
whitespace and therefore strips the trailing newline as well.

Signed-off-by: Manuel Traut <manut at linutronix.de>
[torbenh: use split() instead of using splitlines()]
Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/repomanager.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/elbepack/repomanager.py b/elbepack/repomanager.py
index a1b4f500..e9057205 100644
--- a/elbepack/repomanager.py
+++ b/elbepack/repomanager.py
@@ -90,7 +90,7 @@ class RepoBase(object):
             repo_conf = self.fs.read_file("conf/distributions")
             for l in repo_conf:
                 if l.startswith("SignWith"):
-                    self.keyid = l.split(" ")[1]
+                    self.keyid = l.split()[1]
                     unlock_key(self.keyid)
         else:
             self.keyid = generate_elbe_internal_key()
-- 
2.11.0




More information about the elbe-devel mailing list