[elbe-devel] [PATCH 3/4] Generate elbe-keyring.gpg if not building from cdrom

dion at linutronix.de dion at linutronix.de
Wed Jun 26 12:57:55 CEST 2019


From: Olivier Dion <dion at linutronix.de>

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/commands/init.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
index 08f77d1e..0b6bde73 100644
--- a/elbepack/commands/init.py
+++ b/elbepack/commands/init.py
@@ -227,6 +227,17 @@ def run_command(argv):
         os.system(
             '7z x -o%s "%s" elbe-keyring.gpg' %
             (out_path, opt.cdrom))
+    else:
+        keys = []
+        for key in xml.all(".//raw-key"):
+            keys.append(key.et.text)
+        env = {"GNUPGHOME":out_path}
+        command_out('gpg --import',
+                    stdin="".join(keys),
+                    env_add=env)
+        keyring = os.path.join(out_path, "elbe-keyring.gpg")
+        command_out('gpg --export --output "%s"' % keyring,
+                    env_add=env)
 
     if opt.devel:
         out_real = os.path.realpath(out_path)
-- 
2.11.0




More information about the elbe-devel mailing list