From 42d9f2ffd47101f279299df026d27026e816f8c7 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 30 Jan 2011 17:54:16 -0800 Subject: getRawMaskAtom: handle user negative incrementals --- pym/portage/package/ebuild/_config/MaskManager.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'pym') diff --git a/pym/portage/package/ebuild/_config/MaskManager.py b/pym/portage/package/ebuild/_config/MaskManager.py index 66278ec5e..be7a21274 100644 --- a/pym/portage/package/ebuild/_config/MaskManager.py +++ b/pym/portage/package/ebuild/_config/MaskManager.py @@ -1,4 +1,4 @@ -# Copyright 2010 Gentoo Foundation +# Copyright 2010-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 __all__ = ( @@ -16,6 +16,9 @@ class MaskManager(object): user_config=True, strict_umatched_removal=False): self._punmaskdict = ExtendedAtomDict(list) self._pmaskdict = ExtendedAtomDict(list) + # Preserves atoms that are eliminated by negative + # incrementals in user_pkgmasklines. + self._pmaskdict_raw = ExtendedAtomDict(list) #Read profile/package.mask from every repo. #Repositories inherit masks from their parent profiles and @@ -89,18 +92,23 @@ class MaskManager(object): #Stack everything together. At this point, only user_pkgmasklines may contain -atoms. #Don't warn for unmatched -atoms here, since we don't do it for any other user config file. + raw_pkgmasklines = stack_lists([repo_pkgmasklines, profile_pkgmasklines], \ + incremental=1, remember_source_file=True, warn_for_unmatched_removal=False, ignore_repo=True) pkgmasklines = stack_lists([repo_pkgmasklines, profile_pkgmasklines, user_pkgmasklines], \ incremental=1, remember_source_file=True, warn_for_unmatched_removal=False, ignore_repo=True) pkgunmasklines = stack_lists([repo_pkgunmasklines, profile_pkgunmasklines, user_pkgunmasklines], \ incremental=1, remember_source_file=True, warn_for_unmatched_removal=False, ignore_repo=True) + for x, source_file in raw_pkgmasklines: + self._pmaskdict_raw.setdefault(x.cp, []).append(x) + for x, source_file in pkgmasklines: self._pmaskdict.setdefault(x.cp, []).append(x) for x, source_file in pkgunmasklines: self._punmaskdict.setdefault(x.cp, []).append(x) - for d in (self._pmaskdict, self._punmaskdict): + for d in (self._pmaskdict_raw, self._pmaskdict, self._punmaskdict): for k, v in d.items(): d[k] = tuple(v) @@ -152,7 +160,7 @@ class MaskManager(object): """ cp = cpv_getkey(cpv) - mask_atoms = self._pmaskdict.get(cp) + mask_atoms = self._pmaskdict_raw.get(cp) if mask_atoms: pkg = "".join((cpv, _slot_separator, slot)) if repo: -- cgit v1.2.3-1-g7c22