summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2011-04-27 13:36:15 -0700
committerZac Medico <zmedico@gentoo.org>2011-04-27 13:36:15 -0700
commit9e813764e3056fe9a376af70d9bc80749980fe5e (patch)
tree9935d7f722682135733b983789b3aa16bdc461ed /pym
parent37b0564dc8013f4495be59eb6af8dc9535c7c695 (diff)
downloadportage-9e813764e3056fe9a376af70d9bc80749980fe5e.tar.gz
portage-9e813764e3056fe9a376af70d9bc80749980fe5e.tar.bz2
portage-9e813764e3056fe9a376af70d9bc80749980fe5e.zip
--autounmask: Don't change masked/forced flags
This will fix bug #364701.
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/depgraph.py4
-rw-r--r--pym/portage/tests/resolver/ResolverPlayground.py2
-rw-r--r--pym/portage/tests/resolver/test_autounmask.py31
3 files changed, 35 insertions, 2 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 391c845de..a0a4622ee 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3120,6 +3120,10 @@ class depgraph(object):
not check_required_use(required_use, new_use, pkg.iuse.is_valid_flag):
return old_use
+ if pkg.use.mask.intersection(new_changes) or \
+ pkg.use.force.intersection(new_changes):
+ return old_use
+
self._dynamic_config._needed_use_config_changes[pkg] = (new_use, new_changes)
backtrack_infos = self._dynamic_config._backtrack_infos
backtrack_infos.setdefault("config", {})
diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index eb591bba5..276b193b8 100644
--- a/pym/portage/tests/resolver/ResolverPlayground.py
+++ b/pym/portage/tests/resolver/ResolverPlayground.py
@@ -32,7 +32,7 @@ class ResolverPlayground(object):
"""
config_files = frozenset(("package.use", "package.mask", "package.keywords", \
- "package.unmask", "package.properties", "package.license"))
+ "package.unmask", "package.properties", "package.license", "use.mask", "use.force"))
def __init__(self, ebuilds={}, installed={}, profile={}, repo_configs={}, \
user_config={}, sets={}, world=[], debug=False):
diff --git a/pym/portage/tests/resolver/test_autounmask.py b/pym/portage/tests/resolver/test_autounmask.py
index 9e50be7ed..bd3a5f99e 100644
--- a/pym/portage/tests/resolver/test_autounmask.py
+++ b/pym/portage/tests/resolver/test_autounmask.py
@@ -16,6 +16,12 @@ class AutounmaskTestCase(TestCase):
"dev-libs/C-1": {},
"dev-libs/D-1": {},
+ #ebuilds to test if we allow changing of masked or forced flags
+ "dev-libs/E-1": { "SLOT": 1, "DEPEND": "dev-libs/F[masked-flag]", "EAPI": 2},
+ "dev-libs/E-2": { "SLOT": 2, "DEPEND": "dev-libs/G[-forced-flag]", "EAPI": 2},
+ "dev-libs/F-1": { "IUSE": "masked-flag"},
+ "dev-libs/G-1": { "IUSE": "forced-flag"},
+
#ebuilds to test keyword changes
"app-misc/Z-1": { "KEYWORDS": "~x86", "DEPEND": "app-misc/Y" },
"app-misc/Y-1": { "KEYWORDS": "~x86" },
@@ -185,9 +191,32 @@ class AutounmaskTestCase(TestCase):
options = { "--autounmask": True },
use_changes = None,
success = False),
+
+ #Make sure we don't change masked/forced flags.
+ ResolverPlaygroundTestCase(
+ ["dev-libs/E:1"],
+ options = {"--autounmask": True},
+ use_changes = None,
+ success = False),
+ ResolverPlaygroundTestCase(
+ ["dev-libs/E:2"],
+ options = {"--autounmask": True},
+ use_changes = None,
+ success = False),
)
- playground = ResolverPlayground(ebuilds=ebuilds)
+ profile = {
+ "use.mask":
+ (
+ "masked-flag",
+ ),
+ "use.force":
+ (
+ "forced-flag",
+ ),
+ }
+
+ playground = ResolverPlayground(ebuilds=ebuilds, profile=profile)
try:
for test_case in test_cases:
playground.run_TestCase(test_case)