summaryrefslogtreecommitdiffstats
path: root/bin/emerge
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2006-04-07 16:55:37 +0000
committerAlec Warner <antarus@gentoo.org>2006-04-07 16:55:37 +0000
commitdb97f5cbf00b18f9389f6f8566e51299f66643fd (patch)
tree6613fcdcd69c40f4caf970f383ff6e3e509a5220 /bin/emerge
parenta77105d363fa24f2bdca881e4761a337494eadcc (diff)
downloadportage-db97f5cbf00b18f9389f6f8566e51299f66643fd.tar.gz
portage-db97f5cbf00b18f9389f6f8566e51299f66643fd.tar.bz2
portage-db97f5cbf00b18f9389f6f8566e51299f66643fd.zip
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
Diffstat (limited to 'bin/emerge')
-rwxr-xr-xbin/emerge12
1 files changed, 9 insertions, 3 deletions
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))