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 1SSz5x-0007gE-CM for garchives@archives.gentoo.org; Fri, 11 May 2012 23:17:57 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3C8FBE07B4; Fri, 11 May 2012 23:17:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id E9F7EE07B4 for ; Fri, 11 May 2012 23:17:47 +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 2D9831B4044 for ; Fri, 11 May 2012 23:17:47 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id EA601E542D for ; Fri, 11 May 2012 23:17:45 +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: <1336778252.912c564620f59d6e8d0752121c931095ba832ef2.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, ... X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/package/ebuild/_config/LocationsManager.py pym/portage/package/ebuild/config.py pym/portage/repository/config.py X-VCS-Directories: pym/portage/package/ebuild/ pym/portage/package/ebuild/_config/ pym/portage/repository/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 912c564620f59d6e8d0752121c931095ba832ef2 X-VCS-Branch: master Date: Fri, 11 May 2012 23:17:45 +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: a37f567c-a3dd-4f19-b030-680e874720cb X-Archives-Hash: 16b3863ea85198a463c74d613197c1fc commit: 912c564620f59d6e8d0752121c931095ba832ef2 Author: Zac Medico gentoo org> AuthorDate: Fri May 11 23:17:32 2012 +0000 Commit: Zac Medico gentoo org> CommitDate: Fri May 11 23:17:32 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D912c5646 Avoid redundant layout.conf parsing. By passing the RepoConfigLoader instance into LocationsManager, we can re-use previously parsed layout.conf data. The RepoConfigLoader instance will also be useful for bug #414961. --- .../package/ebuild/_config/LocationsManager.py | 19 ++++++++++++++= ----- pym/portage/package/ebuild/config.py | 2 +- pym/portage/repository/config.py | 3 ++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/pym/portage/package/ebuild/_config/LocationsManager.py b/pym= /portage/package/ebuild/_config/LocationsManager.py index 9c73612..368c0dd 100644 --- a/pym/portage/package/ebuild/_config/LocationsManager.py +++ b/pym/portage/package/ebuild/_config/LocationsManager.py @@ -52,11 +52,20 @@ class LocationsManager(object): self.abs_user_config =3D os.path.join(self.config_root, USER_CONFIG_PA= TH) self.config_profile_path =3D config_profile_path =20 - def load_profiles(self, known_repository_paths): - known_repos =3D set(os.path.realpath(x) for x in known_repository_path= s) - # force a trailing '/' for ease of doing startswith checks - known_repos =3D tuple((x + '/', parse_layout_conf(x)[0]) - for x in known_repos) + def load_profiles(self, repositories, known_repository_paths): + known_repository_paths =3D set(os.path.realpath(x) + for x in known_repository_paths) + + known_repos =3D [] + for x in known_repository_paths: + try: + layout_data =3D {"profile-formats": + repositories.get_repo_for_location(x).profile_formats} + except KeyError: + layout_data =3D parse_layout_conf(x)[0] + # force a trailing '/' for ease of doing startswith checks + known_repos.append((x + '/', layout_data)) + known_repos =3D tuple(known_repos) =20 if self.config_profile_path is None: self.config_profile_path =3D \ diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/e= build/config.py index 45b048c..1a88250 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -427,7 +427,7 @@ class config(object): self.lookuplist =3D [self.configdict["env"]] self.repositories =3D load_repository_config(self) =20 - locations_manager.load_profiles(known_repos) + locations_manager.load_profiles(self.repositories, known_repos) =20 profiles_complex =3D locations_manager.profiles_complex self.profiles =3D locations_manager.profiles diff --git a/pym/portage/repository/config.py b/pym/portage/repository/co= nfig.py index e544c57..3716569 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -49,7 +49,7 @@ class RepoConfig(object): 'cache_formats', 'create_manifest', 'disable_manifest', 'eapi', 'eclass_db', 'eclass_locations', 'eclass_overrides', 'format', 'locati= on', 'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name', - 'name', 'priority', 'sign_commit', 'sign_manifest', 'sync', 'thin_mani= fest', + 'name', 'priority', 'profile_formats', 'sign_commit', 'sign_manifest',= 'sync', 'thin_manifest', 'update_changelog', 'user_location', 'portage1_profiles', 'portage1_profiles_compat') =20 @@ -153,6 +153,7 @@ class RepoConfig(object): for value in ('allow-missing-manifest', 'allow-provide-virtual', 'cache-formats', 'create-manifest', 'disable-manifest', 'manifest-hashes', + 'profile-formats', 'sign-commit', 'sign-manifest', 'thin-manifest', 'update-changelog')= : setattr(self, value.lower().replace("-", "_"), layout_data[value]) =20