Merged from trunk 5748:5757
authorFabian Groffen <grobian@gentoo.org>
Tue, 23 Jan 2007 08:54:55 +0000 (08:54 -0000)
committerFabian Groffen <grobian@gentoo.org>
Tue, 23 Jan 2007 08:54:55 +0000 (08:54 -0000)
For bug #163083, handle an UnsupportedAPIException thrown from the prerm
phase.

use svn export (SpankMan)

move gen_usr_ldscript from eutils to toolchain-funcs to reflect actual
eclass status (SpankMan)

remove functions that dont exist anymore: draw_line get_number_of_jobs
have_NPTL (SpankMan)

document the functions built_with_use doicon newicon domenu newmenu
ebeep emktemp epause make_wrapper preserve_old_lib
preserve_old_lib_notify (SpankMan)

For bug #163219, handle binpkgs that have missing PF metadata.

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

pym/portage.py
pym/portage_exception.py

index 94d147cf9f8fffd6b6b62c360969745c855e35a6..ac2b0df7bab971f289f97ff9d2b4e3444f185e06 100644 (file)
@@ -6526,8 +6526,9 @@ class binarytree(object):
                                        mytbz2 = xpak.tbz2(full_path)
                                        # For invalid packages, mycat could be None.
                                        mycat = mytbz2.getfile("CATEGORY")
+                                       mypf = mytbz2.getfile("PF")
                                        mypkg = myfile[:-5]
-                                       if not mycat:
+                                       if not mycat or not mypf:
                                                #old-style or corrupt package
                                                writemsg("!!! Invalid binary package: '%s'\n" % full_path,
                                                        noiselevel=-1)
@@ -6539,7 +6540,7 @@ class binarytree(object):
                                        mycat = mycat.strip()
                                        if mycat != mydir and mydir != "All":
                                                continue
-                                       if mypkg != mytbz2.getfile("PF").strip():
+                                       if mypkg != mypf.strip():
                                                continue
                                        mycpv = mycat + "/" + mypkg
                                        if mycpv in pkg_paths:
@@ -6892,8 +6893,15 @@ class dblink:
 
                self.settings.load_infodir(self.dbdir)
                if myebuildpath:
-                       doebuild_environment(myebuildpath, "prerm", self.myroot,
-                               self.settings, 0, 0, self.vartree.dbapi)
+                       try:
+                               doebuild_environment(myebuildpath, "prerm", self.myroot,
+                                       self.settings, 0, 0, self.vartree.dbapi)
+                       except portage_exception.UnsupportedAPIException, e:
+                               # Sometimes this happens due to corruption of the EAPI file.
+                               writemsg("!!! FAILED prerm: %s\n" % \
+                                       os.path.join(self.dbdir, "EAPI"), noiselevel=-1)
+                               writemsg("%s\n" % str(e), noiselevel=-1)
+                               return 1
                        catdir = os.path.dirname(self.settings["PORTAGE_BUILDDIR"])
                        portage_util.ensure_dirs(os.path.dirname(catdir),
                                uid=portage_uid, gid=portage_gid, mode=070, mask=0)
index 95e03640d7a7689bd78615a019b78e3a88cf4cfc..7d5ca82c2c8c231b0c48652c037bde42d21ba22b 100644 (file)
@@ -76,8 +76,8 @@ class InvalidAtom(PortagePackageException):
 
 class UnsupportedAPIException(PortagePackageException):
        """Unsupported API"""
-       def __init__(self, cpv, api):
-               self.cpv, self.api = cpv, api
+       def __init__(self, cpv, eapi):
+               self.cpv, self.eapi = cpv, eapi
        def __str__(self):
                return "Unable to do any operations on '%s', due to the fact it's EAPI is higher then this portage versions.  Please upgrade to a portage version that supports EAPI %s" % (self.cpv, self.eapi)