From cc1a29fec2960f93c61623907e8d161e72d83f53 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Tue, 29 Mar 2011 15:43:13 +0200 Subject: [PATCH] [entropy.client.interfaces.dep] use sha1 for hashing disk cache keys rather than hash() --- libraries/entropy/client/interfaces/dep.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libraries/entropy/client/interfaces/dep.py b/libraries/entropy/client/interfaces/dep.py index 08102704a..07ded0391 100644 --- a/libraries/entropy/client/interfaces/dep.py +++ b/libraries/entropy/client/interfaces/dep.py @@ -1174,11 +1174,14 @@ class CalculatorsMixin: # there is no need to update this cache when "match" # will be installed, because at that point # clientmatch[0] will differ. - c_hash = "%s|%s" % ( + hash_str = "%s|%s" % ( match, clientmatch, ) - c_hash = "%s%s" % (EntropyCacher.CACHE_IDS['library_breakage'], hash(c_hash),) + sha = hashlib.sha1() + sha.update(const_convert_to_rawstring(repr(hash_str))) + c_hash = sha.hexdigest() + c_hash = "%s%s" % (EntropyCacher.CACHE_IDS['library_breakage'], c_hash,) if self.xcache: cached = self._cacher.pop(c_hash) if cached is not None: