From: Michael Tremer Date: Thu, 21 Jul 2011 20:27:07 +0000 (+0200) Subject: Fix hash comparison issue. X-Git-Tag: 0.9.4~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0bbc62e226e080801e480fd13abd4be82df12e73;p=pakfire.git Fix hash comparison issue. --- diff --git a/pakfire/repository/local.py b/pakfire/repository/local.py index 2ff6dea93..00d3f84b5 100644 --- a/pakfire/repository/local.py +++ b/pakfire/repository/local.py @@ -50,7 +50,7 @@ class RepositoryDir(base.RepositoryFactory): # Check UUID at first (faster) and check the file hash to be # absolutely sure. - if pkg.uuid == pkg_exists.uuid and pkg.hash1 and pkg_exists.hash1: + if pkg.uuid == pkg_exists.uuid and pkg.hash1 == pkg_exists.hash1: # Do not copy the file if it is already okay. copy = False @@ -59,8 +59,10 @@ class RepositoryDir(base.RepositoryFactory): else: os.unlink(repo_filename) + del pkg_exists + if copy: - logging.debug("Copying package '%s' to repository." % pkg.friendly_name) + logging.debug("Copying package '%s' to repository." % pkg) repo_dirname = os.path.dirname(repo_filename) if not os.path.exists(repo_dirname): os.makedirs(repo_dirname)