diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-08-24 01:27:20 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-08-24 01:27:20 +0000 |
commit | 798c0ccee6086934d087e60d5ade55f67d2bfc5f (patch) | |
tree | a34597054e221b3fb2ae4a5891ea6a220663e8dd /pym/portage/update.py | |
parent | 8ca9b10e498c29352eed0c9e4a6fd181454504a9 (diff) | |
download | portage-798c0ccee6086934d087e60d5ade55f67d2bfc5f.tar.gz portage-798c0ccee6086934d087e60d5ade55f67d2bfc5f.tar.bz2 portage-798c0ccee6086934d087e60d5ade55f67d2bfc5f.zip |
Bug #282505 - Fix unicode handling for package moves in binary packages.v2.2_rc40
svn path=/main/trunk/; revision=14134
Diffstat (limited to 'pym/portage/update.py')
-rw-r--r-- | pym/portage/update.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pym/portage/update.py b/pym/portage/update.py index ca67370cd..56e6709c0 100644 --- a/pym/portage/update.py +++ b/pym/portage/update.py @@ -55,12 +55,18 @@ def update_dbentries(update_iter, mydata): dict containing only the updated items.""" updated_items = {} for k, mycontent in mydata.iteritems(): - if k not in ignored_dbentries: + k_unicode = _unicode_decode(k, + encoding=_encodings['repo.content'], errors='replace') + if k_unicode not in ignored_dbentries: + mycontent = _unicode_decode(mycontent, + encoding=_encodings['repo.content'], errors='replace') orig_content = mycontent for update_cmd in update_iter: mycontent = update_dbentry(update_cmd, mycontent) if mycontent != orig_content: - updated_items[k] = mycontent + updated_items[k] = _unicode_encode(mycontent, + encoding=_encodings['repo.content'], + errors='backslashreplace') return updated_items def fixdbentries(update_iter, dbdir): @@ -77,7 +83,7 @@ def fixdbentries(update_iter, dbdir): updated_items = update_dbentries(update_iter, mydata) for myfile, mycontent in updated_items.iteritems(): file_path = os.path.join(dbdir, myfile) - write_atomic(file_path, mycontent) + write_atomic(file_path, mycontent, encoding=_encodings['repo.content']) return len(updated_items) > 0 def grab_updates(updpath, prev_mtimes=None): |