[elbe-devel] [PATCH 2/5] elbepack: debinstall: reduce output spam when importing key

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Aug 20 11:52:12 CEST 2024


The detailed outputs are not useful to the user.
If there is a failure, the output will still be shown.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/debinstaller.py | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/elbepack/debinstaller.py b/elbepack/debinstaller.py
index 163d0919fb8e..631e9accffc5 100644
--- a/elbepack/debinstaller.py
+++ b/elbepack/debinstaller.py
@@ -94,14 +94,11 @@ def setup_apt_keyring(gpg_home, keyring_fname):
 
     trustkeys = os.listdir('/etc/apt/trusted.gpg.d')
     for key in trustkeys:
-        print(f'Import {key}: ')
-        try:
-            subprocess.run([
-                'gpg', *gpg_options,
-                '--import', os.path.join('/etc/apt/trusted.gpg.d', key),
-            ], check=True)
-        except subprocess.CalledProcessError:
-            print(f'adding keyring "{key}" to keyring "{ring_path}" failed')
+        print(f'Import {key}')
+        subprocess.run([
+            'gpg', *gpg_options,
+            '--import', os.path.join('/etc/apt/trusted.gpg.d', key),
+        ], check=True, capture_output=True)
 
 
 def verify_release(tmp, base_url):

-- 
2.46.0



More information about the elbe-devel mailing list