[elbe-devel] [PATCH v2 01/10] pkgutils: dont fallback to nonvirtapt code, when virtapt is avail

Torben Hohn torben.hohn at linutronix.de
Tue Apr 17 12:39:32 CEST 2018


catching any Exception is a bad idea anyways.
Also silently falling back to the old code, which is currently broken
is not useful. This masks problems with not properly authenticated
packages, etc.

This patch just removes the fallback, and lets the exception raise.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/pkgutils.py | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/elbepack/pkgutils.py b/elbepack/pkgutils.py
index 563935e0..619fa9c2 100644
--- a/elbepack/pkgutils.py
+++ b/elbepack/pkgutils.py
@@ -143,14 +143,10 @@ def get_uri(prj, defs, arch, target_pkg, incl_deps=False):
     apt_keys = get_key_list(prj)
 
     if virtapt_imported:
-        try:
-            if arch == "default":
-                arch = prj.text("buildimage/arch", default=defs, key="arch")
-            suite = prj.text("suite")
-            v = get_virtaptcache(arch, suite, apt_sources, "", apt_keys)
-        except Exception as e:
-            print("python-apt failed, using fallback code")
-            return get_uri_nonvirtapt(apt_sources, target_pkg, arch)
+        if arch == "default":
+            arch = prj.text("buildimage/arch", default=defs, key="arch")
+        suite = prj.text("suite")
+        v = get_virtaptcache(arch, suite, apt_sources, "", apt_keys)
 
         ret = v.get_uri(suite, arch, target_pkg, incl_deps)
         return ret
-- 
2.11.0




More information about the elbe-devel mailing list