summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/package/ebuild/_config/MaskManager.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/pym/portage/package/ebuild/_config/MaskManager.py b/pym/portage/package/ebuild/_config/MaskManager.py
index ef72aeb8f..25d679e9f 100644
--- a/pym/portage/package/ebuild/_config/MaskManager.py
+++ b/pym/portage/package/ebuild/_config/MaskManager.py
@@ -24,14 +24,23 @@ class MaskManager(object):
#Add ::repo specs to every atom to make sure atoms only affect
#packages from the current repo.
+ # Cache the repository-wide package.mask files as a particular
+ # repo may be often referenced by others as the master.
+ pmask_cache = {}
+
+ def grab_pmask(loc):
+ if loc not in pmask_cache:
+ pmask_cache[loc] = grabfile_package(
+ os.path.join(loc, "profiles", "package.mask"),
+ recursive=1, remember_source_file=True, verify_eapi=True)
+ return pmask_cache[loc]
+
repo_pkgmasklines = []
for repo in repositories.repos_with_profiles():
lines = []
- repo_lines = grabfile_package(os.path.join(repo.location, "profiles", "package.mask"), \
- recursive=1, remember_source_file=True, verify_eapi=True)
+ repo_lines = grab_pmask(repo.location)
for master in repo.masters:
- master_lines = grabfile_package(os.path.join(master.location, "profiles", "package.mask"), \
- recursive=1, remember_source_file=True, verify_eapi=True)
+ master_lines = grab_pmask(master.location)
lines.append(stack_lists([master_lines, repo_lines], incremental=1,
remember_source_file=True, warn_for_unmatched_removal=True,
strict_warn_for_unmatched_removal=strict_umatched_removal))