From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 5D65C1381F3 for ; Mon, 24 Jun 2013 17:05:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E8209E09B3; Mon, 24 Jun 2013 17:05:01 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7B344E09B3 for ; Mon, 24 Jun 2013 17:05:01 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 37E5D33E246 for ; Mon, 24 Jun 2013 17:05:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 533D9E468F for ; Mon, 24 Jun 2013 17:04:58 +0000 (UTC) From: "Arfrever Frehtes Taifersar Arahesis" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arfrever Frehtes Taifersar Arahesis" Message-ID: <1372093454.71b294590c5794d69f2f700aebf17c047fda833d.arfrever@gentoo> 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: arfrever X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis X-VCS-Revision: 71b294590c5794d69f2f700aebf17c047fda833d X-VCS-Branch: master Date: Mon, 24 Jun 2013 17:04:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: d317ca66-afa4-4272-bc72-53f380b86b92 X-Archives-Hash: 0be73fdf7f3471e4dce0dbbe3763ea0f commit: 71b294590c5794d69f2f700aebf17c047fda833d Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Mon Jun 24 17:04:14 2013 +0000 Commit: Arfrever Frehtes Taifersar Arahesis gmail com> CommitDate: Mon Jun 24 17:04:14 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=71b29459 Print error when section name set in repos.conf differs from name set inside repository. --- pym/portage/repository/config.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 49af5e8..13de814 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -153,14 +153,14 @@ class RepoConfig(object): eapi = None missing = True + self.name = name if self.location is not None: eapi = read_corresponding_eapi_file(os.path.join(self.location, REPO_NAME_LOC)) - name, missing = self._read_valid_repo_name(self.location) + self.name, missing = self._read_valid_repo_name(self.location) elif name == "DEFAULT": missing = False self.eapi = eapi - self.name = name self.missing_repo_name = missing # sign_commit is disabled by default, since it requires Git >=1.7.9, # and key_id configured by `git config user.signingkey key_id` @@ -217,6 +217,10 @@ class RepoConfig(object): self._eapis_banned = frozenset(layout_data['eapis-banned']) self._eapis_deprecated = frozenset(layout_data['eapis-deprecated']) + if name is not None and name != self.name: + raise ValueError(_("Section name '%s' set in repos.conf differs from name '%s' set inside repository") % + (name, self.name)) + def eapi_is_banned(self, eapi): return eapi in self._eapis_banned @@ -500,7 +504,11 @@ class RepoConfigLoader(object): for oname in parser.options(sname): optdict[oname] = parser.get(sname, oname) - repo = RepoConfig(sname, optdict, local_config=local_config) + try: + repo = RepoConfig(sname, optdict, local_config=local_config) + except ValueError as e: + writemsg_level("!!! %s\n" % (e,), level=logging.ERROR, noiselevel=-1) + continue if repo.location and not exists_raise_eaccess(repo.location): writemsg(_("!!! Invalid repos.conf entry '%s'" " (not a dir): '%s'\n") % (sname, repo.location), noiselevel=-1)