summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-18 21:08:40 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-18 21:08:40 +0000
commit5bf0525011ad05b45c043d66f8c0cbc9e605a8f4 (patch)
tree13b90f49141332841a14ca81f8e99cd7a644c5aa /pym
parentca100dbad4dc17bd640419a1d3106f596f201757 (diff)
downloadportage-5bf0525011ad05b45c043d66f8c0cbc9e605a8f4.tar.gz
portage-5bf0525011ad05b45c043d66f8c0cbc9e605a8f4.tar.bz2
portage-5bf0525011ad05b45c043d66f8c0cbc9e605a8f4.zip
Handle EnvironmentError instead of OSError since open()
actually raises IOError. Also, treat a missing SLOT file as SLOT="" since it is currently possible to install an ebuild with an undefined SLOT even though repoman generates a SLOT.missing error with such an ebuild. svn path=/main/trunk/; revision=8174
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/vartree.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index cca5ca9a3..45badc3e3 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -1672,16 +1672,20 @@ class dblink(object):
return 1
inforoot_slot_file = os.path.join(inforoot, "SLOT")
+ slot = None
try:
f = open(inforoot_slot_file)
try:
slot = f.read().strip()
finally:
f.close()
- except OSError, e:
- writemsg("!!! Error reading '%s': %s\n" % (inforoot_slot_file, e),
- noiselevel=-1)
- return 1
+ except EnvironmentError, e:
+ if e.errno != errno.ENOENT:
+ raise
+ del e
+
+ if slot is None:
+ slot = ""
if slot != self.settings["SLOT"]:
writemsg("!!! WARNING: Expected SLOT='%s', got '%s'\n" % \