summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-21 22:14:58 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-21 22:14:58 +0000
commit01db74cf9776abfb86918d633d77c1bad5040b27 (patch)
tree64e0fcdd9f497f9963679f868ab5baae65a8824a /pym
parentTo ease transition while Manifest 1 is being removed, only require hashes tha... (diff)
downloadportage-idfetch-01db74cf9776abfb86918d633d77c1bad5040b27.tar.gz
portage-idfetch-01db74cf9776abfb86918d633d77c1bad5040b27.tar.bz2
portage-idfetch-01db74cf9776abfb86918d633d77c1bad5040b27.zip
For bug #163083, handle an UnsupportedAPIException thrown from the prerm phase.
svn path=/main/trunk/; revision=5749
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py11
-rw-r--r--pym/portage_exception.py4
2 files changed, 11 insertions, 4 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 6eaf919d..8d30da9c 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -6884,8 +6884,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)
diff --git a/pym/portage_exception.py b/pym/portage_exception.py
index 76f2be20..4be72cf9 100644
--- a/pym/portage_exception.py
+++ b/pym/portage_exception.py
@@ -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)