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/repository | |
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/repository')
-rw-r--r-- | pym/portage/repository/config.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 3cb550152..692445013 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -43,7 +43,7 @@ class RepoConfig(object): __slots__ = ['aliases', 'eclass_overrides', 'eclass_locations', 'location', 'user_location', 'masters', 'main_repo', 'missing_repo_name', 'name', 'priority', 'sync', 'format', 'sign_manifest', 'thin_manifest', - 'allow_missing_manifest', 'create_manifest', 'disable_manifest'] + 'allow_missing_manifest', 'create_manifest', 'disable_manifest', 'cache_is_authorative'] def __init__(self, name, repo_opts): """Build a RepoConfig with options in repo_opts @@ -117,6 +117,7 @@ class RepoConfig(object): self.allow_missing_manifest = False self.create_manifest = True self.disable_manifest = False + self.cache_is_authorative = False def load_manifest(self, *args, **kwds): kwds['thin'] = self.thin_manifest @@ -357,6 +358,7 @@ class RepoConfigLoader(object): repo.allow_missing_manifest = manifest_policy != 'strict' repo.create_manifest = manifest_policy != 'false' repo.disable_manifest = manifest_policy == 'false' + repo.cache_is_authorative = layout_data.get('authorative-cache', 'false').lower() == 'true' #Take aliases into account. new_prepos = {} |