aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Luther <SebastianLuther@gmx.de>2011-05-15 19:05:19 (GMT)
committerZac Medico <zmedico@gentoo.org>2011-05-15 19:05:19 (GMT)
commit5eef84cb4b72695548937445019eac24f53d252b (patch)
treeb974529018796e2af11bc209e041dd6e017871a1
parent--autounmask: Allow package.mask changes (diff)
downloadportage-5eef84cb4b72695548937445019eac24f53d252b.zip
portage-5eef84cb4b72695548937445019eac24f53d252b.tar.gz
portage-5eef84cb4b72695548937445019eac24f53d252b.tar.bz2
--autounmask: Treat missing keywords as masks
-rw-r--r--pym/_emerge/depgraph.py9
-rw-r--r--pym/portage/package/ebuild/getmaskingstatus.py3
-rw-r--r--pym/portage/tests/resolver/test_autounmask.py17
3 files changed, 29 insertions, 0 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index d095ce1..80e35c4 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3285,6 +3285,9 @@ class depgraph(object):
if only_use_changes and allow_unmasks:
continue
+ if pkg is not None:
+ break
+
pkg, existing = \
self._wrapped_select_pkg_highest_available_imp(
root, atom, onlydeps=onlydeps,
@@ -3321,6 +3324,7 @@ class depgraph(object):
mreasons = _get_masking_status(pkg, pkgsettings, root_config, use=self._pkg_use_enabled(pkg))
masked_by_unstable_keywords = False
+ masked_by_missing_keywords = False
missing_licenses = None
masked_by_something_else = False
masked_by_p_mask = False
@@ -3332,6 +3336,8 @@ class depgraph(object):
masked_by_something_else = True
elif hint.key == "unstable keyword":
masked_by_unstable_keywords = True
+ if hint.value == "**":
+ masked_by_missing_keywords = True
elif hint.key == "p_mask":
masked_by_p_mask = True
elif hint.key == "license":
@@ -3345,6 +3351,7 @@ class depgraph(object):
if pkg in self._dynamic_config._needed_unstable_keywords:
#If the package is already keyworded, remove the mask.
masked_by_unstable_keywords = False
+ masked_by_missing_keywords = False
if pkg in self._dynamic_config._needed_p_mask_changes:
#If the package is already keyworded, remove the mask.
@@ -3358,7 +3365,9 @@ class depgraph(object):
#Package has already been unmasked.
return True
+ #We treat missing keywords in the same way as masks.
if (masked_by_unstable_keywords and not allow_unstable_keywords) or \
+ (masked_by_missing_keywords and not allow_unmasks) or \
(masked_by_p_mask and not allow_unmasks) or \
(missing_licenses and not allow_license_changes):
#We are not allowed to do the needed changes.
diff --git a/pym/portage/package/ebuild/getmaskingstatus.py b/pym/portage/package/ebuild/getmaskingstatus.py
index e46f788..4eb1625 100644
--- a/pym/portage/package/ebuild/getmaskingstatus.py
+++ b/pym/portage/package/ebuild/getmaskingstatus.py
@@ -149,6 +149,9 @@ def _getmaskingstatus(mycpv, settings, portdb, myrepo=None):
kmask_hint = _UnmaskHint("unstable keyword", kmask)
break
+ if kmask == "missing":
+ kmask_hint = _UnmaskHint("unstable keyword", "**")
+
try:
missing_licenses = settings._getMissingLicenses(mycpv, metadata)
if missing_licenses:
diff --git a/pym/portage/tests/resolver/test_autounmask.py b/pym/portage/tests/resolver/test_autounmask.py
index 62b1522..0689a37 100644
--- a/pym/portage/tests/resolver/test_autounmask.py
+++ b/pym/portage/tests/resolver/test_autounmask.py
@@ -32,6 +32,9 @@ class AutounmaskTestCase(TestCase):
#ebuilds to test mask and keyword changes
"app-text/A-1": {},
"app-text/B-1": { "KEYWORDS": "~x86" },
+ "app-text/C-1": { "KEYWORDS": "" },
+ "app-text/D-1": { "KEYWORDS": "~x86" },
+ "app-text/D-2": { "KEYWORDS": "" },
#ebuilds for mixed test for || dep handling
"sci-libs/K-1": { "DEPEND": " || ( sci-libs/L[bar] || ( sci-libs/M sci-libs/P ) )", "EAPI": 2},
@@ -222,6 +225,19 @@ class AutounmaskTestCase(TestCase):
mergelist = ["app-text/B-1"],
unstable_keywords = ["app-text/B-1"],
needed_p_mask_changes = ["app-text/B-1"]),
+ ResolverPlaygroundTestCase(
+ ["app-text/C"],
+ options = {"--autounmask": True},
+ success = False,
+ mergelist = ["app-text/C-1"],
+ unstable_keywords = ["app-text/C-1"],
+ needed_p_mask_changes = ["app-text/C-1"]),
+ ResolverPlaygroundTestCase(
+ ["app-text/D"],
+ options = {"--autounmask": True},
+ success = False,
+ mergelist = ["app-text/D-1"],
+ unstable_keywords = ["app-text/D-1"])
)
profile = {
@@ -237,6 +253,7 @@ class AutounmaskTestCase(TestCase):
(
"app-text/A",
"app-text/B",
+ "app-text/C",
),
}