[elbe-devel] [PATCH 6/9] pkgutils: remove download_pkg, which is not used anymore
Torben Hohn
torben.hohn at linutronix.de
Wed Jun 26 11:50:25 CEST 2019
Signed-off-by: Torben Hohn <torben.hohn 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]
--
2.11.0
More information about the elbe-devel
mailing list