summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-15 00:15:11 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-15 00:15:11 +0000
commitd4a1b1095779af81dcd786911d27a5bb862d8e91 (patch)
tree1bd638902a76c18d9ef2b34f961004169a0119c1
parentb5b22931b9097aedb7d46589d1ca923ffeeabb67 (diff)
downloadportage-d4a1b1095779af81dcd786911d27a5bb862d8e91.tar.gz
portage-d4a1b1095779af81dcd786911d27a5bb862d8e91.tar.bz2
portage-d4a1b1095779af81dcd786911d27a5bb862d8e91.zip
Fix dblink._unmerge_pkgfiles() to use the correct version of perform_md5
when it falls back to utf8 encoding. svn path=/main/trunk/; revision=14058
-rw-r--r--pym/portage/checksum.py4
-rw-r--r--pym/portage/dbapi/vartree.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/pym/portage/checksum.py b/pym/portage/checksum.py
index 5def1ac8a..0e6a9d552 100644
--- a/pym/portage/checksum.py
+++ b/pym/portage/checksum.py
@@ -6,6 +6,7 @@
import portage
from portage.const import PRIVATE_PATH,PRELINK_BINARY,HASHING_BLOCKSIZE
from portage import os
+from portage import _fs_encoding
from portage import _merge_encoding
from portage import _unicode_encode
import errno
@@ -233,7 +234,8 @@ def perform_checksum(filename, hashname="MD5", calc_prelink=0):
if hashname not in hashfunc_map:
raise portage.exception.DigestException(hashname + \
" hash function not available (needs dev-python/pycrypto)")
- myhash, mysize = hashfunc_map[hashname](myfilename)
+ myhash, mysize = hashfunc_map[hashname](_unicode_encode(myfilename,
+ encoding=_fs_encoding, errors='strict'))
except (OSError, IOError), e:
if e.errno == errno.ENOENT:
raise portage.exception.FileNotFound(myfilename)
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 6729e41e7..40d20876d 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2288,6 +2288,7 @@ class dblink(object):
"""
os = _os_merge
+ perf_md5 = perform_md5
showMessage = self._display_merge
scheduler = self._scheduler
@@ -2391,6 +2392,7 @@ class dblink(object):
pass
else:
os = portage.os
+ perf_md5 = portage.checksum.perform_md5
file_data = pkgfiles[objkey]
file_type = file_data[0]
@@ -2481,7 +2483,7 @@ class dblink(object):
continue
mymd5 = None
try:
- mymd5 = perform_md5(obj, calc_prelink=1)
+ mymd5 = perf_md5(obj, calc_prelink=1)
except FileNotFound, e:
# the file has disappeared between now and our stat call
show_unmerge("---", unmerge_desc["!obj"], file_type, obj)