Bug #236683 - Fix PermissionDenied handling to report the exception type.
authorZac Medico <zmedico@gentoo.org>
Sat, 15 Nov 2008 04:51:25 +0000 (04:51 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 15 Nov 2008 04:51:25 +0000 (04:51 -0000)
(trunk r11922)

svn path=/main/branches/2.1.6/; revision=11923

bin/ebuild
pym/portage/__init__.py

index 6760787c437c38ebf427a87f9cea911d05d46b52..b4ec8701482b41f540e18362dbbe12d12d35fa22 100755 (executable)
@@ -202,7 +202,7 @@ def stale_env_warning():
                        for x in msg:
                                portage.writemsg(">>> %s\n" % x)
 
-from portage.exception import UnsupportedAPIException
+from portage.exception import PermissionDenied, UnsupportedAPIException
 checked_for_stale_env = False
 
 for arg in pargs:
@@ -230,6 +230,9 @@ for arg in pargs:
                for x in msg:
                        portage.writemsg("!!! %s\n" % x, noiselevel=-1)
                a = 1
+       except PermissionDenied, e:
+               portage.writemsg("!!! Permission Denied: %s\n" % (e,), noiselevel=-1)
+               a = 1
        if a == None:
                print "Could not run the required binary?"
                a = 127
index 47751a3b6845a2dbd94f0dd2173e8b00752215e6..888d1ee2e0f6fabfedefcbe5ad6235e8c413ed22 100644 (file)
@@ -5686,7 +5686,7 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
                        elif "digest" in mysettings.features:
                                digestgen(aalist, mysettings, overwrite=0, myportdb=mydbapi)
                except portage.exception.PermissionDenied, e:
-                       writemsg("!!! %s\n" % str(e), noiselevel=-1)
+                       writemsg("!!! Permission Denied: %s\n" % (e,), noiselevel=-1)
                        if mydo in ("digest", "manifest"):
                                return 1