will be written. With this option, \'>=\' operators will be used
whenever possible.
.TP
+.BR "\-\-autounmask\-keep\-masks [ y | n ]"
+If \-\-autounmask is enabled, no changes to package.unmask
+will be created. This leads to unsatisfied dependencies if
+no other solution exists.
+.TP
.BR "\-\-autounmask\-write [ y | n ]"
If \-\-autounmask is enabled, changes are written
to config files, respecting \fBCONFIG_PROTECT\fR and \fB\-\-ask\fR.
default_selection = (pkg, existing)
+ autounmask_keep_masks = self._frozen_config.myopts.get("--autounmask-keep-masks", "n") != "n"
+
if self._dynamic_config._autounmask is True:
if pkg is not None and \
pkg.installed and \
break
for allow_unmasks in (False, True):
- if only_use_changes and allow_unmasks:
+ if allow_unmasks and (only_use_changes or autounmask_keep_masks):
continue
if pkg is not None:
for line in wrap(desc, desc_width):
print(desc_indent + line)
print()
+ print(" " + green("--autounmask-keep-masks") + " [ %s | %s ]" % \
+ (turquoise("y"), turquoise("n")))
+ desc = "If --autounmask is enabled, no changes to " + \
+ "package.unmask will be created. This leads to unsatisfied " + \
+ "dependencies if no other solution exists."
+ for line in wrap(desc, desc_width):
+ print(desc_indent + line)
+ print()
print(" " + green("--autounmask-write") + " [ %s | %s ]" % \
(turquoise("y"), turquoise("n")))
desc = "If --autounmask is enabled, changes are written " + \
default_arg_opts = {
'--ask' : y_or_n,
'--autounmask' : y_or_n,
+ '--autounmask-keep-masks': y_or_n,
'--autounmask-unrestricted-atoms' : y_or_n,
'--autounmask-write' : y_or_n,
'--buildpkg' : y_or_n,
"choices" : true_y_or_n
},
+ "--autounmask-keep-masks": {
+ "help" : "don't add package.unmask entries",
+ "type" : "choice",
+ "choices" : true_y_or_n
+ },
+
"--autounmask-write": {
"help" : "write changes made by --autounmask to disk",
"type" : "choice",
if myoptions.autounmask_unrestricted_atoms in true_y:
myoptions.autounmask_unrestricted_atoms = True
+ if myoptions.autounmask_keep_masks in true_y:
+ myoptions.autounmask_keep_masks = True
+
if myoptions.autounmask_write in true_y:
myoptions.autounmask_write = True
self.assertEqual(test_case.test_success, True, test_case.fail_msg)
finally:
playground.cleanup()
+
+
+ def testAutounmaskKeepMasks(self):
+
+ ebuilds = {
+ "app-text/A-1": {},
+ }
+
+ test_cases = (
+ #Test mask and keyword changes.
+ ResolverPlaygroundTestCase(
+ ["app-text/A"],
+ options = {"--autounmask": True,
+ "--autounmask-keep-masks": "y"},
+ success = False),
+ ResolverPlaygroundTestCase(
+ ["app-text/A"],
+ options = {"--autounmask": True,
+ "--autounmask-keep-masks": "n"},
+ success = False,
+ mergelist = ["app-text/A-1"],
+ needed_p_mask_changes = ["app-text/A-1"]),
+ )
+
+ profile = {
+ "package.mask":
+ (
+ "app-text/A",
+ ),
+ }
+
+ playground = ResolverPlayground(ebuilds=ebuilds, profile=profile)
+
+ try:
+ for test_case in test_cases:
+ playground.run_TestCase(test_case)
+ self.assertEqual(test_case.test_success, True, test_case.fail_msg)
+ finally:
+ playground.cleanup()