Merged from trunk -r14916:14926
authorFabian Groffen <grobian@gentoo.org>
Sun, 6 Dec 2009 10:32:37 +0000 (10:32 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sun, 6 Dec 2009 10:32:37 +0000 (10:32 -0000)
   | 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

pym/_emerge/depgraph.py
pym/portage/update.py

index 4608404a8c21726b26b14034ce8d79b149cb0132..9b7274e00d744ad2d6ee8f82fa343f44b5bee571 100644 (file)
@@ -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:
index c2f8f300602ed2b3f6b76db7baf2e577ab036f38..04812d5a466788987c28d352264f73e3349f3dc8 100644 (file)
@@ -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):