Merged from trunk -r13887:13895
authorFabian Groffen <grobian@gentoo.org>
Tue, 4 Aug 2009 17:00:19 +0000 (17:00 -0000)
committerFabian Groffen <grobian@gentoo.org>
Tue, 4 Aug 2009 17:00:19 +0000 (17:00 -0000)
   | 13888   | Fix a regression caused by the code from bug #278729, which  |
   | zmedico | causes incorrect preference evaluation for cases like        |
   |         | kde-base/nepomuk: || (                                       |
   |         | >=dev-libs/soprano-2.3.0[clucene,dbus,raptor,redland]        |
   |         | >=dev-libs/soprano-2.3.0[clucene,dbus,raptor,java] ) In      |
   |         | cases like this we need to prefer the choice which is        |
   |         | already satisfied by current USE configuration. Thanks to    |
   |         | Maciej Mrozowski <reavertm@poczta.fm> for reporting.         |

   | 13889   | Bug #280259 - Use codecs.open() when reading the Packages    |
   | zmedico | file inside binarytree.inject(), in order to avoid a         |
   |         | UnicodeDecodeError when the file is later written as a       |
   |         | unicode stream (via atomic_ofstream).                        |

   | 13890   | Bug #280259 - Fix binarytree to always open the Packages     |
   | zmedico | file as unicode.                                             |

   | 13891   | Bug #280259 - Fix emaint to call binarytree._load_pkgindex() |
   | zmedico | for unicode handling.                                        |

   | 13892   | Fix dep_zapdeps exception 'ValueError: need more than 3      |
   | zmedico | values to unpack' from r13888.                               |

   | 13893   | In the dep_zapdeps() code from bug #278729, set              |
   | zmedico | all_use_satisfied = False if the choice includes an          |
   |         | unavailable package.                                         |

   | 13894   | Revert the code from bug #278729 for now since it need to be |
   | zmedico | redone in order to account for the issue described in        |
   |         | comment #3.                                                  |

   | 13895   | Bug #280320 - Fix broken _emerge.main ImportError handler..  |
   | zmedico |                                                              |

svn path=/main/branches/prefix/; revision=13899

bin/emaint
bin/emerge
pym/portage/__init__.py
pym/portage/dbapi/bintree.py

index 629948ddd12b4e924783a36f5a488a26be645de2..2fbace95cbc83ab6856e90194071f23ca4cbba3d 100755 (executable)
@@ -118,13 +118,8 @@ class BinhostHandler(object):
                myroot = portage.settings["ROOT"]
                self._bintree = portage.db[myroot]["bintree"]
                self._bintree.populate()
-               self._pkgindex_file = os.path.join(self._bintree.pkgdir, "Packages")
-               self._pkgindex = self._bintree._new_pkgindex()
-               f = open(self._pkgindex_file, 'r')
-               try:
-                       self._pkgindex.read(f)
-               finally:
-                       f.close()
+               self._pkgindex_file = self._bintree._pkgindex_file
+               self._pkgindex = self._bintree._load_pkgindex()
 
        def check(self, onProgress=None):
                missing = []
@@ -180,13 +175,8 @@ class BinhostHandler(object):
                                cpv_all = self._bintree.dbapi.cpv_all()
                                cpv_all.sort()
 
-                               pkgindex = bintree._new_pkgindex()
+                               pkgindex = bintree._load_pkgindex()
                                self._pkgindex = pkgindex
-                               f = open(self._pkgindex_file, 'r')
-                               try:
-                                       self._pkgindex.read(f)
-                               finally:
-                                       f.close()
 
                                metadata = {}
                                for d in pkgindex.packages:
index 10d3deb0f78e4c09d82cf344c4f5e9f523c850f8..ae93e4f2a10ce23095054707d73eb1c7b3a04faf 100755 (executable)
@@ -26,6 +26,7 @@ def debug_signal(signum, frame):
        pdb.set_trace()
 signal.signal(signal.SIGUSR1, debug_signal)
 
+<<<<<<< .working
 # for an explanation on this logic, see pym/_emerge/__init__.py
 import os
 import sys
index e850dcdaee22b343453b9f75631f21bc7b427411..ae17493efc3434f76bd4424e3599cc11c6dd6db2 100644 (file)
@@ -6943,9 +6943,6 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
                                if portage.dep._dep_check_strict:
                                        raise portage.exception.ParseError(
                                                "invalid atom: '%s'" % x)
-                               else:
-                                       # Only real Atom instances are allowed past this point.
-                                       continue
                        else:
                                if x.blocker and x.blocker.overlap.forbid and \
                                        eapi in ("0", "1") and portage.dep._dep_check_strict:
@@ -7167,9 +7164,7 @@ def dep_zapdeps(unreduced, reduced, myroot, use_binaries=0, trees=None):
                for atom in atoms:
                        if atom[:1] == "!":
                                continue
-                       # Ignore USE dependencies here since we don't want USE
-                       # settings to adversely affect || preference evaluation.
-                       avail_pkg = mydbapi.match(atom.without_use)
+                       avail_pkg = mydbapi.match(atom)
                        if avail_pkg:
                                avail_pkg = avail_pkg[-1] # highest (ascending order)
                                avail_slot = "%s:%s" % (dep_getkey(atom),
index 071cc4a63539355f660f560c8c01ef1d16e42625..6bd47ec1faf28dd49f886e619c91d16f4972321e 100644 (file)
@@ -22,6 +22,7 @@ from portage.localization import _
 
 from portage import dep_expand, listdir, _check_distfile, _movefile
 
+import codecs
 import os, errno, stat
 import re
 from itertools import chain, izip
@@ -432,18 +433,8 @@ class binarytree(object):
                                dirs.remove("All")
                        dirs.sort()
                        dirs.insert(0, "All")
-                       pkgindex = self._new_pkgindex()
+                       pkgindex = self._load_pkgindex()
                        pf_index = None
-                       try:
-                               f = open(self._pkgindex_file)
-                       except EnvironmentError:
-                               pass
-                       else:
-                               try:
-                                       pkgindex.read(f)
-                               finally:
-                                       f.close()
-                                       del f
                        if not self._pkgindex_version_supported(pkgindex):
                                pkgindex = self._new_pkgindex()
                        header = pkgindex.header
@@ -649,7 +640,8 @@ class binarytree(object):
                                urldata[1] + urldata[2], "Packages")
                        pkgindex = self._new_pkgindex()
                        try:
-                               f = open(pkgindex_file)
+                               f = codecs.open(pkgindex_file,
+                                       encoding='utf_8', errors='replace')
                                try:
                                        pkgindex.read(f)
                                finally:
@@ -848,17 +840,8 @@ class binarytree(object):
                                self.getname(cpv).split(os.path.sep)[-2] == "All":
                                self._create_symlink(cpv)
                                created_symlink = True
-                       pkgindex = self._new_pkgindex()
-                       try:
-                               f = open(self._pkgindex_file)
-                       except EnvironmentError:
-                               pass
-                       else:
-                               try:
-                                       pkgindex.read(f)
-                               finally:
-                                       f.close()
-                                       del f
+                       pkgindex = self._load_pkgindex()
+
                        if not self._pkgindex_version_supported(pkgindex):
                                pkgindex = self._new_pkgindex()
 
@@ -1099,7 +1082,8 @@ class binarytree(object):
        def _load_pkgindex(self):
                pkgindex = self._new_pkgindex()
                try:
-                       f = open(self._pkgindex_file)
+                       f = codecs.open(self._pkgindex_file, 
+                               encoding='utf8', errors='replace')
                except EnvironmentError:
                        pass
                else: