summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-09-24 06:03:58 +0000
committerZac Medico <zmedico@gentoo.org>2009-09-24 06:03:58 +0000
commitff4638539b575aec08bd042ee40565c21d9df235 (patch)
tree937ec601636fe7e8d7e9b4ed05104dc1b0bec5b8
parent3b645fcd73d9a1c3c2fdaa682f18f90fad5184ce (diff)
downloadportage-ff4638539b575aec08bd042ee40565c21d9df235.tar.gz
portage-ff4638539b575aec08bd042ee40565c21d9df235.tar.bz2
portage-ff4638539b575aec08bd042ee40565c21d9df235.zip
Decode directory names where appropriate in digestcheck(). Thanks to
Arfrever for reporting. svn path=/main/trunk/; revision=14399
-rw-r--r--pym/portage/__init__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 8e6811ffd..7909a403e 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -5357,6 +5357,20 @@ def digestcheck(myfiles, mysettings, strict=0, justmanifest=0):
return 0
continue
for d in dirs:
+ try:
+ d = _unicode_decode(d,
+ encoding=_encodings['fs'], errors='strict')
+ except UnicodeDecodeError:
+ d = _unicode_decode(d,
+ encoding=_encodings['fs'], errors='replace')
+ writemsg(_("!!! Path contains invalid "
+ "character(s) for encoding '%s': '%s'") \
+ % (_encodings['fs'], os.path.join(parent, d)),
+ noiselevel=-1)
+ if strict:
+ return 0
+ dirs.remove(d)
+ continue
if d.startswith(".") or d == "CVS":
dirs.remove(d)
for f in files: