[elbe-devel] [PATCH 3/3] rpcaptcache: use our own implementation of fetch_binary

Bastian Germann bage at linutronix.de
Fri Dec 6 19:34:18 CET 2019


Am 04.12.19 um 17:37 schrieb Torben Hohn:
> in "elbe fetch_initvm_pkgs" Version.fetch_binary() produced an error:
> 
> ------------------------------------------------------------------------------------------------------------------------------------------
> Oct 20 07:39:21 in-target: Traceback (most recent call last):
> Oct 20 07:39:21 in-target:   File "/bin/elbe", line 55, in <module>
> Oct 20 07:39:21 in-target:     cmdmod.run_command(sys.argv[2:])
> Oct 20 07:39:21 in-target:   File "/usr/lib/python2.7/dist-packages/elbepack/commands/fetch_initvm_pkgs.py", line 108, in run_command
> Oct 20 07:39:21 in-target:     ElbeAcquireProgress(cb=None))
> Oct 20 07:39:21 in-target:   File "/usr/lib/python2.7/dist-packages/apt/package.py", line 867, in fetch_binary
> Oct 20 07:39:21 in-target:     if _file_is_same(destfile, self.size, self._records.md5_hash):
> Oct 20 07:39:21 in-target: SystemError: error return without exception set
> ------------------------------------------------------------------------------------------------------------------------------------------
> 
> The code there uses our own implementation of fetch_binary() which does
> not try to access "_records.md5_hash". And there it works.
> 
> The same thing can also happen in rpcaptcache. So use our own versnion

Typo: version

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

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

> ---
>  elbepack/rpcaptcache.py | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/elbepack/rpcaptcache.py b/elbepack/rpcaptcache.py
> index afb29ed6f..7cc19b9e8 100644
> --- a/elbepack/rpcaptcache.py
> +++ b/elbepack/rpcaptcache.py
> @@ -21,7 +21,7 @@ from apt import Cache
>  
>  from elbepack.aptprogress import (ElbeAcquireProgress, ElbeInstallProgress,
>                                    ElbeOpProgress)
> -from elbepack.aptpkgutils import getalldeps, APTPackage
> +from elbepack.aptpkgutils import getalldeps, APTPackage, fetch_binary
>  from elbepack.log import async_logging
>  
>  
> @@ -282,8 +282,9 @@ class RPCAPTCache(InChRootObject):
>              pkgver = p.installed
>          else:
>              pkgver = p.versions[version]
> -        rel_filename = pkgver.fetch_binary(path,
> -                                           ElbeAcquireProgress())
> +        rel_filename = fetch_binary(pkgver,
> +                                    path,
> +                                    ElbeAcquireProgress())
>          return self.rfs.fname(rel_filename)
>  
>      def download_source(self, pkgname, path, version=None):
> 



More information about the elbe-devel mailing list