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 1RfogL-0003Ya-E1 for garchives@archives.gentoo.org; Wed, 28 Dec 2011 08:16:17 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 824E721C11E; Wed, 28 Dec 2011 08:16:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 3B71421C11E for ; Wed, 28 Dec 2011 08:16:10 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 752EA1B400C for ; Wed, 28 Dec 2011 08:16:09 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 8C1ED80043 for ; Wed, 28 Dec 2011 08:16:08 +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: e2f5b48cd9533eea83b02c97cbab9e0df86e78e8 Date: Wed, 28 Dec 2011 08:16:08 +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: 884594da-88ee-49d9-a537-3be6b664f3a0 X-Archives-Hash: 55f05b0c2a040f557e2c5626f3319866 commit: e2f5b48cd9533eea83b02c97cbab9e0df86e78e8 Author: Zac Medico gentoo org> AuthorDate: Wed Dec 28 08:15:58 2011 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Dec 28 08:15:58 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3De2f5b48c RepoConfigLoader: don't mix duplicate repo config RepoConfig.update() was being used to copy attributes from one instance to another, possibly leading to inappropriate mixing of layout.conf attributes from separate copies of the same repo. This is common with repoman, for example, when temporarily overriding an rsync repo with another copy of the same repo from CVS. --- pym/portage/repository/config.py | 35 +++++++++++++++++---------------= --- 1 files changed, 17 insertions(+), 18 deletions(-) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/co= nfig.py index 4bf995e..1db691b 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -318,6 +318,14 @@ class RepoConfigLoader(object): ' '.join(prepos['DEFAULT'].masters) =20 if overlays: + # We need a copy of the original repos.conf data, since we're + # going to modify the prepos dict and some of the RepoConfig + # objects that we put in prepos may have to be discarded if + # they get overridden by a repository with the same name but + # a different location. This is common with repoman, for example, + # when temporarily overriding an rsync repo with another copy + # of the same repo from CVS. + repos_conf =3D prepos.copy() #overlay priority is negative because we want them to be looked befor= e any other repo base_priority =3D 0 for ov in overlays: @@ -325,21 +333,15 @@ class RepoConfigLoader(object): repo_opts =3D default_repo_opts.copy() repo_opts['location'] =3D ov repo =3D RepoConfig(None, repo_opts) - # repos_conf_opts may contain options from various places: - # 1) /etc/portage/repos.conf - # 2) $location/metadata/layout.conf if repos.conf specified - # the repo location - # 3) A RepoConfig instance corresponding to a previously - # processed path in the current list of overlays which - # referred to a repository with the same name. - repos_conf_opts =3D prepos.get(repo.name) + # repos_conf_opts contains options from repos.conf + repos_conf_opts =3D repos_conf.get(repo.name) if repos_conf_opts is not None: - if repos_conf_opts.aliases is not None: - repo.aliases =3D repos_conf_opts.aliases - if repos_conf_opts.eclass_overrides is not None: - repo.eclass_overrides =3D repos_conf_opts.eclass_overrides - if repos_conf_opts.masters is not None: - repo.masters =3D repos_conf_opts.masters + # Selectively copy only the attributes which + # repos.conf is allowed to override. + for k in ('aliases', 'eclass_overrides', 'masters'): + v =3D getattr(repos_conf_opts, k, None) + if v is not None: + setattr(repo, k, v) =20 if repo.name in prepos: old_location =3D prepos[repo.name].location @@ -348,10 +350,6 @@ class RepoConfigLoader(object): ignored_location_map[old_location] =3D repo.name if old_location =3D=3D portdir: portdir =3D repo.user_location - prepos[repo.name].update(repo) - repo =3D prepos[repo.name] - else: - prepos[repo.name] =3D repo =20 if ov =3D=3D portdir and portdir not in port_ov: repo.priority =3D -1000 @@ -359,6 +357,7 @@ class RepoConfigLoader(object): repo.priority =3D base_priority base_priority +=3D 1 =20 + prepos[repo.name] =3D repo else: writemsg(_("!!! Invalid PORTDIR_OVERLAY" " (not a dir): '%s'\n") % ov, noiselevel=3D-1)