summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/emerge20
1 files changed, 8 insertions, 12 deletions
diff --git a/bin/emerge b/bin/emerge
index 89241d33d..b5e043190 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -853,20 +853,16 @@ def getlist(mode):
mylines=portage.settings.packages
elif mode=="world":
try:
- myfile = open(os.path.join(portage.root, portage.WORLD_FILE), "r")
- mylines=myfile.readlines()
+ file_path = os.path.join(portage.root, portage.WORLD_FILE)
+ myfile = open(file_path, "r")
+ mylines = myfile.readlines()
myfile.close()
- except OSError:
- print "!!! Couldn't open "+pfile+"; exiting."
- sys.exit(1)
- except IOError, e:
- #Permission denied is a fatal error, as opposed to a missing file
- if e.errno == errno.EACCES:
- raise
- else:
- if "--quiet" not in myopts:
- portage.writemsg(red("\n!!! ") + "Warning %s does not exist.\n" % os.path.join(portage.root, portage.WORLD_FILE) )
+ except (OSError, IOError), e:
+ if e.errno == errno.ENOENT:
+ portage.writemsg("\n!!! World file does not exist: '%s'\n" % file_path)
mylines=[]
+ else:
+ raise
mynewlines=[]
for x in mylines:
myline=string.join(string.split(x))