[elbe-devel] [PATCH 2/2] pkgutils: fixup error returns

John Ogness john.ogness at linutronix.de
Sat Apr 28 02:14:41 CEST 2018


When packages are not found, the code returns invalid data in the
form of empty strings. This makes it quite difficult to identify
the problem when that situation occurs.

Change the invalid data to strings that are still invalid, but
help illustrate the problem.

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

diff --git a/elbepack/pkgutils.py b/elbepack/pkgutils.py
index 81ed9d96..02c6d995 100644
--- a/elbepack/pkgutils.py
+++ b/elbepack/pkgutils.py
@@ -122,6 +122,8 @@ def get_uri_nonvirtapt(apt_sources, target_pkg, arch):
             if pkg:
                 return [(target_pkg, pkg, "")]
 
+    return [(target_pkg, "nonexistent://" + target_pkg, "")]
+
 
 def get_uri(prj, defs, arch, target_pkg, incl_deps=False):
     if arch == "default":
@@ -147,7 +149,7 @@ def get_uri(prj, defs, arch, target_pkg, incl_deps=False):
     else:
         return get_uri_nonvirtapt(apt_sources, target_pkg, arch)
 
-    return "", ""
+    return [(target_pkg, "nonexistent://" + target_pkg, "")]
 
 
 def get_dsc_size(fname):
-- 
2.11.0




More information about the elbe-devel mailing list