From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, ...
Date: Fri, 11 May 2012 23:17:45 +0000 (UTC) [thread overview]
Message-ID: <1336778252.912c564620f59d6e8d0752121c931095ba832ef2.zmedico@gentoo> (raw)
commit: 912c564620f59d6e8d0752121c931095ba832ef2
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri May 11 23:17:32 2012 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri May 11 23:17:32 2012 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=912c5646
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 = os.path.join(self.config_root, USER_CONFIG_PATH)
self.config_profile_path = config_profile_path
- def load_profiles(self, known_repository_paths):
- known_repos = set(os.path.realpath(x) for x in known_repository_paths)
- # force a trailing '/' for ease of doing startswith checks
- known_repos = tuple((x + '/', parse_layout_conf(x)[0])
- for x in known_repos)
+ def load_profiles(self, repositories, known_repository_paths):
+ known_repository_paths = set(os.path.realpath(x)
+ for x in known_repository_paths)
+
+ known_repos = []
+ for x in known_repository_paths:
+ try:
+ layout_data = {"profile-formats":
+ repositories.get_repo_for_location(x).profile_formats}
+ except KeyError:
+ layout_data = parse_layout_conf(x)[0]
+ # force a trailing '/' for ease of doing startswith checks
+ known_repos.append((x + '/', layout_data))
+ known_repos = tuple(known_repos)
if self.config_profile_path is None:
self.config_profile_path = \
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/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 = [self.configdict["env"]]
self.repositories = load_repository_config(self)
- locations_manager.load_profiles(known_repos)
+ locations_manager.load_profiles(self.repositories, known_repos)
profiles_complex = locations_manager.profiles_complex
self.profiles = locations_manager.profiles
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.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', 'location',
'main_repo', 'manifest_hashes', 'masters', 'missing_repo_name',
- 'name', 'priority', 'sign_commit', 'sign_manifest', 'sync', 'thin_manifest',
+ 'name', 'priority', 'profile_formats', 'sign_commit', 'sign_manifest', 'sync', 'thin_manifest',
'update_changelog', 'user_location', 'portage1_profiles',
'portage1_profiles_compat')
@@ -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])
next reply other threads:[~2012-05-11 23:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 23:17 Zac Medico [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-01-19 8:04 [gentoo-commits] proj/portage:master commit in: pym/portage/package/ebuild/, pym/portage/package/ebuild/_config/, Arfrever Frehtes Taifersar Arahesis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336778252.912c564620f59d6e8d0752121c931095ba832ef2.zmedico@gentoo \
--to=zmedico@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox