From: Fabian Groffen Date: Sun, 6 Dec 2009 10:32:37 +0000 (-0000) Subject: Merged from trunk -r14916:14926 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=70ab1d14d6b2a6aa49a1e026ca9345fbdffebd08;p=portage.git Merged from trunk -r14916:14926 | 14921 | Bug #295351 - Make update_dbentries() return unicode if it's | | zmedico | given unicode, and bytes if it's given bytes. | | 14922 | Bug #280336, comment #2 - Clear the package selection cache | | zmedico | when packages are added to the graph. This fixes incorrect | | | choices that happen in some cases. | svn path=/main/branches/prefix/; revision=14939 --- diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 4608404a8..9b7274e00 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -997,6 +997,7 @@ class depgraph(object): self._dynamic_config._slot_pkg_map[pkg.root][pkg.slot_atom] = pkg self._dynamic_config.mydbapi[pkg.root].cpv_inject(pkg) self._dynamic_config._filtered_trees[pkg.root]["porttree"].dbapi._clear_cache() + self._dynamic_config._highest_pkg_cache.clear() self._check_masks(pkg) if not pkg.installed: diff --git a/pym/portage/update.py b/pym/portage/update.py index c2f8f3006..04812d5a4 100644 --- a/pym/portage/update.py +++ b/pym/portage/update.py @@ -63,15 +63,19 @@ def update_dbentries(update_iter, mydata): k_unicode = _unicode_decode(k, encoding=_encodings['repo.content'], errors='replace') if k_unicode not in ignored_dbentries: + orig_content = mycontent mycontent = _unicode_decode(mycontent, encoding=_encodings['repo.content'], errors='replace') + is_encoded = mycontent is not orig_content orig_content = mycontent for update_cmd in update_iter: mycontent = update_dbentry(update_cmd, mycontent) if mycontent != orig_content: - updated_items[k] = _unicode_encode(mycontent, - encoding=_encodings['repo.content'], - errors='backslashreplace') + if is_encoded: + mycontent = _unicode_encode(mycontent, + encoding=_encodings['repo.content'], + errors='backslashreplace') + updated_items[k] = mycontent return updated_items def fixdbentries(update_iter, dbdir):