diff options
author | Arfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org> | 2010-11-06 22:24:12 +0100 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <Arfrever@Gentoo.Org> | 2010-11-06 22:24:12 +0100 |
commit | 7f97afdcfa06629d43f65706c4a2e36a8ae217d3 (patch) | |
tree | 36d2f77f65a6aa94e8e569575a3a61491da41e0c | |
parent | 7668f958a76f8d1b2585d406b1c64c6d37801319 (diff) | |
download | portage-7f97afdcfa06629d43f65706c4a2e36a8ae217d3.tar.gz portage-7f97afdcfa06629d43f65706c4a2e36a8ae217d3.tar.bz2 portage-7f97afdcfa06629d43f65706c4a2e36a8ae217d3.zip |
Calculate path to package.mask file only once per profile.
-rw-r--r-- | pym/portage/package/ebuild/getmaskingreason.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pym/portage/package/ebuild/getmaskingreason.py b/pym/portage/package/ebuild/getmaskingreason.py index 044546179..6a0cf424c 100644 --- a/pym/portage/package/ebuild/getmaskingreason.py +++ b/pym/portage/package/ebuild/getmaskingreason.py @@ -47,7 +47,10 @@ def getmaskingreason(mycpv, metadata=None, settings=None, portdb=None, return_lo locations.append(os.path.join(settings["PORTAGE_CONFIGROOT"], USER_CONFIG_PATH)) locations.reverse() - pmasklists = [(x, grablines(os.path.join(x, "package.mask"), recursive=1)) for x in locations] + pmasklists = [] + for profile in locations: + pmask_filename = os.path.join(profile, "package.mask") + pmasklists.append((pmask_filename, grablines(pmask_filename, recursive=1))) pmaskdict = settings._mask_manager._pmaskdict if mycp in pmaskdict: @@ -57,7 +60,7 @@ def getmaskingreason(mycpv, metadata=None, settings=None, portdb=None, return_lo for pmask in pmasklists: comment = "" comment_valid = -1 - pmask_filename = os.path.join(pmask[0], "package.mask") + pmask_filename = pmask[0] for i in range(len(pmask[1])): l = pmask[1][i].strip() try: @@ -79,7 +82,7 @@ def getmaskingreason(mycpv, metadata=None, settings=None, portdb=None, return_lo else: return comment elif comment_valid != -1: - # Apparently this comment applies to muliple masks, so + # Apparently this comment applies to multiple masks, so # it remains valid until a blank line is encountered. comment_valid += 1 if return_location: |