From: Alec Warner Date: Fri, 7 Apr 2006 16:55:37 +0000 (-0000) Subject: Thanks to jforman for finding this one, emerge was not helpful when permissions on... X-Git-Tag: v2.1_pre8~12 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=db97f5cbf00b18f9389f6f8566e51299f66643fd;p=portage.git Thanks to jforman for finding this one, emerge was not helpful when permissions on the world file are not so good, so in the case of permission denied, we reraise, essentially telling the user we can't read the world file. In the case of it not existing, we assume the user knows what they are doing and we print a squelchable warning message. svn path=/main/trunk/; revision=3089 --- diff --git a/bin/emerge b/bin/emerge index 4dbcfd76d..95f866063 100755 --- a/bin/emerge +++ b/bin/emerge @@ -6,6 +6,7 @@ import os,sys os.environ["PORTAGE_CALLER"]="emerge" sys.path = ["/usr/lib/portage/pym"]+sys.path +import errno try: import portage @@ -846,9 +847,14 @@ def getlist(mode): except OSError: print "!!! Couldn't open "+pfile+"; exiting." sys.exit(1) - except IOError: - #world file doesn't exist - mylines=[] + 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) ) + mylines=[] mynewlines=[] for x in mylines: myline=string.join(string.split(x))