summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-22 23:26:48 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-22 23:26:48 +0000
commitb7c4d023faa00a6c93658550567b8fce2a3c6457 (patch)
treed7b8d3c9efa6d8cc2728991d7128771aa2545447 /pym/portage.py
parent3f1c8f55f56b39955f0ba4c927be2d780e9f3a4a (diff)
downloadportage-b7c4d023faa00a6c93658550567b8fce2a3c6457.tar.gz
portage-b7c4d023faa00a6c93658550567b8fce2a3c6457.tar.bz2
portage-b7c4d023faa00a6c93658550567b8fce2a3c6457.zip
When an unprivileged user runs portage (not in the portage group), use metadata_overlay together with a volatile in-memory cache module in order to implement cache writes. This allows, for example, a user who's not in the portage group to run `ebuild foo.ebuild digest` (issue reported by Charlie Shepherd <masterdriverz@gentoo.org>).
svn path=/main/trunk/; revision=5354
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 4349dcca4..e67231ca0 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -3236,8 +3236,8 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
# Only try and fetch the files if we are going to need them ...
# otherwise, if user has FEATURES=noauto and they run `ebuild clean
# unpack compile install`, we will try and fetch 4 times :/
- need_distfiles = (mydo in ("digest", "fetch", "unpack") or \
- mydo != "manifest" and "noauto" not in features)
+ need_distfiles = (mydo in ("fetch", "unpack") or \
+ mydo not in ("digest", "manifest") and "noauto" not in features)
if need_distfiles and not fetch(
fetchme, mysettings, listonly=listonly, fetchonly=fetchonly):
return 1
@@ -5168,9 +5168,18 @@ class portdbapi(dbapi):
# XXX: REMOVE THIS ONCE UNUSED_0 IS YANKED FROM auxdbkeys
# ~harring
filtered_auxdbkeys = filter(lambda x: not x.startswith("UNUSED_0"), auxdbkeys)
- for x in self.porttrees:
- # location, label, auxdbkeys
- self.auxdb[x] = self.auxdbmodule(self.depcachedir, x, filtered_auxdbkeys, gid=portage_gid)
+ if secpass < 1:
+ from cache import metadata_overlay, volatile
+ for x in self.porttrees:
+ self.auxdb[x] = metadata_overlay.database(
+ self.depcachedir, x, filtered_auxdbkeys,
+ gid=portage_gid, db_rw=volatile.database,
+ db_ro=self.auxdbmodule)
+ else:
+ for x in self.porttrees:
+ # location, label, auxdbkeys
+ self.auxdb[x] = self.auxdbmodule(
+ self.depcachedir, x, filtered_auxdbkeys, gid=portage_gid)
# Selectively cache metadata in order to optimize dep matching.
self._aux_cache_keys = set(["EAPI", "KEYWORDS", "SLOT"])
self._aux_cache = {}