From: fuzzyray Date: Thu, 28 Feb 2008 23:43:45 +0000 (-0000) Subject: Fix traceback when accessing the portage db. (Bug #211716) X-Git-Tag: gentoolkit-0.2.4.3~36 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c5cc3e4e7c44041ec56c0f08f1ff4ec283dee533;p=gentoolkit.git Fix traceback when accessing the portage db. (Bug #211716) svn path=/; revision=477 --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index baa3ec0..1c94086 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,7 @@ +2008-02-28: Paul Varner + * gentoolkit: Fix traceback when accessing the portage + db. (Bug #211716) + 2008-02-21: Paul Varner * revdep-rebuild: "Use /etc/init.d/functions.sh instead of /sbin/functions.sh. (Bug 210940) diff --git a/trunk/src/gentoolkit/__init__.py b/trunk/src/gentoolkit/__init__.py index ecbea69..668da0d 100644 --- a/trunk/src/gentoolkit/__init__.py +++ b/trunk/src/gentoolkit/__init__.py @@ -27,11 +27,20 @@ except ImportError: import re from threading import Lock -settingslock = Lock() -settings = portage.config(clone=portage.settings) -porttree = portage.db[portage.root]["porttree"] -vartree = portage.db[portage.root]["vartree"] -virtuals = portage.db[portage.root]["virtuals"] +try: + import portage.exception as portage_exception +except ImportError: + import portage_exception + +try: + settingslock = Lock() + settings = portage.config(clone=portage.settings) + porttree = portage.db[portage.root]["porttree"] + vartree = portage.db[portage.root]["vartree"] + virtuals = portage.db[portage.root]["virtuals"] +except portage_exception.PermissionDenied, e: + sys.stderr.write("Permission denied: '%s'\n" % str(e)) + sys.exit(e.errno) Config = { "verbosityLevel": 3