diff options
author | Brian Harring <ferringb@chromium.org> | 2011-09-30 02:37:04 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-09-30 10:32:34 -0700 |
commit | a72a01746638debe472496bd8fc661992a6ba08b (patch) | |
tree | 68ab715443a3b4650a7440aad6179add386eba88 /pym/portage/dbapi/porttree.py | |
parent | c2efbad8402a7e8904c7353a9930e87ea128b962 (diff) | |
download | portage-a72a01746638debe472496bd8fc661992a6ba08b.tar.gz portage-a72a01746638debe472496bd8fc661992a6ba08b.tar.bz2 portage-a72a01746638debe472496bd8fc661992a6ba08b.zip |
layout.conf: allow a repository to state the cache is authorative
By authorative, this means "the cache is accurate; skip validation". While
a useful hint for a slight speedup in validation, the true gain is for
repositories that are distributed in a fashion that doesn't preserve mtime;
git primarily. Setting authorative-cache = true results in portage
skipping mtime validation checks for the bundled cache, allowing
for git vcs based repos to distribute a cache.
BUG=chromium-os:21049
TEST=dump a cache into metadata/cache, touch it to now, set layout.conf
to authorative-cache=true, verify it doesn't generate cache entries
for that repo.
Change-Id: I92423e679bc171d2411a18d6d3ac22e8ef457753
Diffstat (limited to 'pym/portage/dbapi/porttree.py')
-rw-r--r-- | pym/portage/dbapi/porttree.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index e679f000c..ab3824727 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -215,10 +215,12 @@ class portdbapi(dbapi): if x in self._pregen_auxdb: continue if os.path.isdir(os.path.join(x, "metadata", "cache")): - self._pregen_auxdb[x] = self.metadbmodule( + conf = self.repositories.get_repo_for_location(x) + cache = self._pregen_auxdb[x] = self.metadbmodule( x, "metadata/cache", filtered_auxdbkeys, readonly=True) + cache.is_authorative = conf.cache_is_authorative try: - self._pregen_auxdb[x].ec = self._repo_info[x].eclass_db + cache.ec = self._repo_info[x].eclass_db except AttributeError: pass # Selectively cache metadata in order to optimize dep matching. @@ -441,10 +443,11 @@ class portdbapi(dbapi): eapi = metadata.get('EAPI', '').strip() if not eapi: eapi = '0' - if not (eapi[:1] == '-' and eapi_is_supported(eapi[1:])) and \ - emtime == metadata['_mtime_'] and \ - eclass_db.is_eclass_data_valid(metadata['_eclasses_']): - doregen = False + if not (eapi[:1] == '-' and eapi_is_supported(eapi[1:])): + if auxdb.is_authorative or ( \ + emtime == metadata['_mtime_'] and \ + eclass_db.is_eclass_data_valid(metadata['_eclasses_'])): + doregen = False if not doregen: break |