of package.mask and package.unmask files for unmatched removal atoms.
parser.add_option('-d', '--include-dev', dest='include_dev', action='store_true',
default=False, help='include dev profiles in dependency checks')
+ parser.add_option('--unmatched-removal', dest='unmatched_removal', action='store_true',
+ default=False, help='enable strict checking of package.mask and package.unmask files for unmatched removal atoms')
+
parser.add_option('--without-mask', dest='without_mask', action='store_true',
default=False, help='behave as if no package.mask entries exist (not allowed with commit mode)')
config_profile_path=prof.abs_path,
config_incrementals=repoman_incrementals,
local_config=False,
+ _unmatched_removal=options.unmatched_removal,
env=env)
if options.without_mask:
dep_settings._mask_manager = \
\fB\-d\fR, \fB\-\-include\-dev\fR
Include dev profiles in dependency checks.
.TP
+\fB\-\-unmatched\-removal\fR
+Enable strict checking of package.mask and package.unmask files for
+unmatched removal atoms.
+.TP
\fB\-\-without\-mask\fR
Behave as if no package.mask entries exist (not allowed with commit mode)
.TP
class MaskManager(object):
- def __init__(self, pmask_locations, abs_user_config, user_config=True):
+ def __init__(self, pmask_locations, abs_user_config,
+ user_config=True, strict_umatched_removal=False):
self._punmaskdict = ExtendedAtomDict(list)
self._pmaskdict = ExtendedAtomDict(list)
for x in repo_profiles:
repo_pkgmasklines.append(stack_lists([grabfile_package(
os.path.join(x, "package.mask"), recursive=1, remember_source_file=True, verify_eapi=True)], \
- incremental=1, remember_source_file=True, warn_for_unmatched_removal=True))
+ incremental=1, remember_source_file=True,
+ warn_for_unmatched_removal=True,
+ strict_warn_for_unmatched_removal=strict_umatched_removal))
repo_pkgunmasklines.append(stack_lists([grabfile_package(
os.path.join(x, "package.unmask"), recursive=1, remember_source_file=True, verify_eapi=True)], \
- incremental=1, remember_source_file=True, warn_for_unmatched_removal=True))
+ incremental=1, remember_source_file=True,
+ warn_for_unmatched_removal=True,
+ strict_warn_for_unmatched_removal=strict_umatched_removal))
repo_pkgmasklines = list(chain.from_iterable(repo_pkgmasklines))
repo_pkgunmasklines = list(chain.from_iterable(repo_pkgunmasklines))
profile_pkgunmasklines.append(grabfile_package(
os.path.join(x, "package.unmask"), recursive=1, remember_source_file=True, verify_eapi=True))
profile_pkgmasklines = stack_lists(profile_pkgmasklines, incremental=1, \
- remember_source_file=True, warn_for_unmatched_removal=True)
+ remember_source_file=True, warn_for_unmatched_removal=True,
+ strict_warn_for_unmatched_removal=strict_umatched_removal)
profile_pkgunmasklines = stack_lists(profile_pkgunmasklines, incremental=1, \
- remember_source_file=True, warn_for_unmatched_removal=True)
+ remember_source_file=True, warn_for_unmatched_removal=True,
+ strict_warn_for_unmatched_removal=strict_umatched_removal)
#Read /etc/portage/package.mask. Don't stack it to allow the user to
#remove mask atoms from everywhere with -atoms.
def __init__(self, clone=None, mycpv=None, config_profile_path=None,
config_incrementals=None, config_root=None, target_root=None,
- _eprefix=None, local_config=True, env=None):
+ _eprefix=None, local_config=True, env=None, _unmatched_removal=False):
"""
@param clone: If provided, init will use deepcopy to copy by value the instance.
@type clone: Instance of config class.
@param env: The calling environment which is used to override settings.
Defaults to os.environ if unspecified.
@type env: dict
+ @param _unmatched_removal: Enabled by repoman when the
+ --unmatched-removal option is given.
+ @type _unmatched_removal: Boolean
"""
# rename local _eprefix variable for convenience
self.configdict["conf"].get("ACCEPT_LICENSE", ""))
#Read package.mask and package.unmask from profiles and optionally from user config
- self._mask_manager = MaskManager(locations_manager.pmask_locations, abs_user_config, user_config=local_config)
+ self._mask_manager = MaskManager(locations_manager.pmask_locations,
+ abs_user_config, user_config=local_config,
+ strict_umatched_removal=_unmatched_removal)
self._virtuals_manager = VirtualsManager(self.profiles)