[elbe-devel] [PATCH 2/2] virtapt: do not require /etc/apt/trusted.gpg

John Ogness john.ogness at linutronix.de
Fri Mar 16 11:50:32 CET 2018


Before elbe adds any keys specified in the xml file, setup_gpg()
copies /etc/apt/trusted.gpg from the host to use as the elbe apt
keyring. This was implemented in b78d59f8114f ("virtapt: use
etc/apt/trusted.gpg instead of etc/apt/trusted.gpg.d"). However,
trusted.gpg only contains locally added keys and may not exist.

Only copy trusted.gpg from the host if it actually exists. If it
does not exist, setup_gpg() will create an empty keyring for use
elbe to use.

Signed-off-by: John Ogness <john.ogness at linutronix.de>
---
 elbepack/virtapt.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index 6bdadc4b..295d4e36 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -162,7 +162,8 @@ class VirtApt:
                   "fix this problem")
             sys.exit(20)
 
-        system('cp /etc/apt/trusted.gpg "%s"' % ring_path)
+        if os.path.exists("/etc/apt/trusted.gpg"):
+            system('cp /etc/apt/trusted.gpg "%s"' % ring_path)
 
         gpg_options = '--keyring "%s" --no-auto-check-trustdb ' \
                       '--trust-model always --no-default-keyring ' \
-- 
2.11.0




More information about the elbe-devel mailing list