+2008-02-28: Paul Varner <fuzzyray@gentoo.org>
+ * gentoolkit: Fix traceback when accessing the portage
+ db. (Bug #211716)
+
2008-02-21: Paul Varner <fuzzyray@gentoo.org>
* revdep-rebuild: "Use /etc/init.d/functions.sh instead of
/sbin/functions.sh. (Bug 210940)
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