From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1R9lD1-0008Pj-8z for garchives@archives.gentoo.org; Fri, 30 Sep 2011 22:05:31 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1471C21C1A2; Fri, 30 Sep 2011 22:05:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id C898C21C1A2 for ; Fri, 30 Sep 2011 22:05:22 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2051F1B4011 for ; Fri, 30 Sep 2011 22:05:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 583A180042 for ; Fri, 30 Sep 2011 22:05:21 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/repository/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/repository/config.py X-VCS-Directories: pym/portage/repository/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: b33e1b6d26f9c4df6a1b6773e5471e2caa1012b3 Date: Fri, 30 Sep 2011 22:05:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: ab8008000ae16d2e3a8583d311f4ff39 commit: b33e1b6d26f9c4df6a1b6773e5471e2caa1012b3 Author: Zac Medico gentoo org> AuthorDate: Fri Sep 30 22:05:00 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri Sep 30 22:05:00 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3Db33e1b6d repos.conf: implement trust-authoritative-cache This controls whether or not the layout.conf "authoritative-cache =3D true" setting will be trusted for a particular repo. It can be enabled globally by setting "trust-authoritative-cache =3D true" in the [DEFAULT] section of repos.conf. --- pym/portage/repository/config.py | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/co= nfig.py index 424b89d..846de39 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -43,7 +43,8 @@ class RepoConfig(object): =20 __slots__ =3D ['aliases', 'eclass_overrides', 'eclass_locations', 'loca= tion', 'user_location', 'masters', 'main_repo', 'missing_repo_name', 'name', 'priority', 'sync', 'format', 'sign_manif= est', 'thin_manifest', - 'allow_missing_manifest', 'create_manifest', 'disable_manifest', 'cach= e_is_authoritative'] + 'allow_missing_manifest', 'create_manifest', 'disable_manifest', 'cach= e_is_authoritative', + 'trust_authoritative_cache'] =20 def __init__(self, name, repo_opts): """Build a RepoConfig with options in repo_opts @@ -119,6 +120,11 @@ class RepoConfig(object): self.disable_manifest =3D False self.cache_is_authoritative =3D False =20 + trust_authoritative_cache =3D repo_opts.get('trust-authoritative-cache= ') + if trust_authoritative_cache is not None: + trust_authoritative_cache =3D trust_authoritative_cache.lower() =3D=3D= 'true' + self.trust_authoritative_cache =3D trust_authoritative_cache + def load_manifest(self, *args, **kwds): kwds['thin'] =3D self.thin_manifest kwds['allow_missing'] =3D self.allow_missing_manifest @@ -135,6 +141,8 @@ class RepoConfig(object): self.eclass_overrides =3D new_repo.eclass_overrides if new_repo.masters is not None: self.masters =3D new_repo.masters + if new_repo.trust_authoritative_cache is not None: + self.trust_authoritative_cache =3D new_repo.trust_authoritative_cache if new_repo.name is not None: self.name =3D new_repo.name self.missing_repo_name =3D new_repo.missing_repo_name @@ -222,6 +230,12 @@ class RepoConfigLoader(object): if prepos['DEFAULT'].masters is not None: default_repo_opts['masters'] =3D \ ' '.join(prepos['DEFAULT'].masters) + if prepos['DEFAULT'].trust_authoritative_cache is not None: + if prepos['DEFAULT'].trust_authoritative_cache: + default_repo_opts['trust-authoritative-cache'] =3D 'true' + else: + default_repo_opts['trust-authoritative-cache'] =3D 'false' + if overlays: #overlay priority is negative because we want them to be looked befor= e any other repo base_priority =3D 0 @@ -241,6 +255,12 @@ class RepoConfigLoader(object): if repo_conf_opts.masters is not None: repo_opts['masters'] =3D \ ' '.join(repo_conf_opts.masters) + if repo_conf_opts.trust_authoritative_cache is not None: + if repo_conf_opts.trust_authoritative_cache: + repo_opts['trust-authoritative-cache'] =3D 'true' + else: + repo_opts['trust-authoritative-cache'] =3D 'false' + repo =3D RepoConfig(repo.name, repo_opts) if repo.name in prepos: old_location =3D prepos[repo.name].location @@ -359,6 +379,8 @@ class RepoConfigLoader(object): repo.create_manifest =3D manifest_policy !=3D 'false' repo.disable_manifest =3D manifest_policy =3D=3D 'false' repo.cache_is_authoritative =3D layout_data.get('authoritative-cache'= , 'false').lower() =3D=3D 'true' + if not repo.trust_authoritative_cache: + repo.cache_is_authoritative =3D False =20 #Take aliases into account. new_prepos =3D {}