Make digestgen() handle PermissionDenied internally by returning failure, so
authorZac Medico <zmedico@gentoo.org>
Sat, 15 Nov 2008 04:59:42 +0000 (04:59 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 15 Nov 2008 04:59:42 +0000 (04:59 -0000)
callers like repoman don't need exception handling.

svn path=/main/trunk/; revision=11924

pym/portage/__init__.py

index 8f7defff8a328699d51f849c8316d1f6c54c9cf7..d9ce6db6bb70cd0ac11c5256282f7ecd6e98d0c3 100644 (file)
@@ -4260,7 +4260,11 @@ def digestgen(myarchives, mysettings, overwrite=1, manifestonly=0, myportdb=None
                        writemsg(("!!! File %s doesn't exist, can't update " + \
                                "Manifest\n") % e, noiselevel=-1)
                        return 0
-               mf.write(sign=False)
+               try:
+                       mf.write(sign=False)
+               except portage.exception.PermissionDenied, e:
+                       writemsg("!!! Permission Denied: %s\n" % (e,), noiselevel=-1)
+                       return 0
                if "assume-digests" not in mysettings.features:
                        distlist = mf.fhashdict.get("DIST", {}).keys()
                        distlist.sort()