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

Manuel Traut manuel.traut at linutronix.de
Wed Apr 18 16:35:34 CEST 2018


On Tue, Apr 17, 2018 at 12:39:32PM +0200, Torben Hohn wrote:
> 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.

probably it leads to new behaviour (user visible stacktraces) that need to
be addressed. However it is a step into the right direction, so

> Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>

Reviewed-by: Manuel Traut <manut at linutronix.de>

and will be added to devel/elbe-3.0

please remember to update your copyright statement in the header. This time,
i'll fix it up manually.

Thanks,

  Manuel

> ---
>  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
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel



More information about the elbe-devel mailing list