summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-18 21:10:21 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-18 21:10:21 +0000
commite4b006f51f451c124d8928c88bf38ab749ae5c11 (patch)
treee183bd5a43affee6e3aeb95c19922da83e065fee
parent2e790c87a42eca204d5b48fda404525cbec7d5da (diff)
downloadportage-e4b006f51f451c124d8928c88bf38ab749ae5c11.tar.gz
portage-e4b006f51f451c124d8928c88bf38ab749ae5c11.tar.bz2
portage-e4b006f51f451c124d8928c88bf38ab749ae5c11.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. (trunk r8174) svn path=/main/branches/2.1.2/; revision=8175
-rw-r--r--pym/portage.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 932d7c4b8..91bfc3402 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -7878,16 +7878,20 @@ class dblink:
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" % \