[elbe-devel] [PATCH v2 07/22] pkgutils: remove download_pkg, which is not used anymore

Bastian Germann bage at linutronix.de
Tue Jul 2 16:53:32 CEST 2019


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

Reviewed-by: Bastian Germann <bage at linutronix.de>

> ---
>  elbepack/pkgutils.py | 57 ----------------------------------------------------
>  1 file changed, 57 deletions(-)
> 
> diff --git a/elbepack/pkgutils.py b/elbepack/pkgutils.py
> index f36f38fee..3d6957506 100644
> --- a/elbepack/pkgutils.py
> +++ b/elbepack/pkgutils.py
> @@ -84,60 +84,3 @@ def get_dsc_size(fname):
>                  sz += int(f[1])
>  
>      return sz
> -
> -
> -def download_pkg(prj,
> -                 target_dir,
> -                 defs,
> -                 package,
> -                 arch="default",
> -                 incl_deps=False,
> -                 log=None):
> -
> -    # pylint: disable=too-many-arguments
> -    # pylint: disable=too-many-locals
> -    # pylint: disable=too-many-branches
> -
> -    try:
> -        urilist = get_uri(prj, defs, arch, package, incl_deps)
> -    except KeyError:
> -        raise NoPackageException('no package %s available' % package)
> -    except SystemError:
> -        raise NoPackageException('a configured mirror is not reachable')
> -    except CommandError:
> -        raise NoPackageException("couldn't download package %s" % package)
> -
> -    if not urilist:
> -        raise NoPackageException("couldn't download package %s" % package)
> -
> -    for u in urilist:
> -        sha256 = u[2]
> -        uri = u[1]
> -        dest = os.path.join(target_dir, "%s.deb" % u[0])
> -
> -        try:
> -            if uri.startswith("file://"):
> -                system('cp "%s" "%s"' % (uri[len("file://"):], dest))
> -            elif uri.startswith("http://") or uri.startswith("ftp://"):
> -                system('wget -O "%s" "%s"' % (dest, uri))
> -            else:
> -                raise NoPackageException('could not retreive %s' % uri)
> -        except CommandError:
> -            raise NoPackageException("couldn't download package %s" % package)
> -
> -        if sha256:
> -            try:
> -                validate_sha256(dest, sha256)
> -            except HashValidationFailed as e:
> -                raise NoPackageException('%s failed to verify: %s' % package,
> -                                         e.message)
> -        else:
> -            if log:
> -                log.printo("WARNING: Using untrusted %s package" % package)
> -            else:
> -                print("-----------------------------------------------------")
> -                print("WARNING:")
> -                print("Using untrusted %s package" % package)
> -                print("-----------------------------------------------------")
> -
> -    return [y[0] for y in urilist]
> 



More information about the elbe-devel mailing list