diff options
author | Sebastian Luther <SebastianLuther@gmx.de> | 2012-02-26 10:34:31 +0100 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-02-26 01:59:00 -0800 |
commit | b684a8d3a73da02423d090c58c0f1536c25b093b (patch) | |
tree | 658ae4a7ea25609220bf92e011c936469ae4287d /pym/portage/tests | |
parent | c9a0df701f983b41fd0f1aac7bb4536f771846cb (diff) | |
download | portage-b684a8d3a73da02423d090c58c0f1536c25b093b.tar.gz portage-b684a8d3a73da02423d090c58c0f1536c25b093b.tar.bz2 portage-b684a8d3a73da02423d090c58c0f1536c25b093b.zip |
autounmask: Avoid unmasking live versions if possible
Before this patch the allowed changes were:
1. USE
2. USE + ~arch + license
3. USE + ~arch + license + missing keywords + masks
With this patch:
1. USE
2. USE + ~arch + license
3. USE + ~arch + license + missing keywords
4. USE + ~arch + license + masks
5. USE + ~arch + license + missing keywords + masks
This avoids unmasking live versions, which are typically masked
and have missing keywords to be avoided if there is a regular
masked version available.
Diffstat (limited to 'pym/portage/tests')
-rw-r--r-- | pym/portage/tests/resolver/test_autounmask.py | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/pym/portage/tests/resolver/test_autounmask.py b/pym/portage/tests/resolver/test_autounmask.py index 3da1c2510..46dbab18e 100644 --- a/pym/portage/tests/resolver/test_autounmask.py +++ b/pym/portage/tests/resolver/test_autounmask.py @@ -391,7 +391,11 @@ class AutounmaskTestCase(TestCase): def testAutounmaskKeepMasks(self): - + """ + Ensure that we try to use a masked version with keywords before trying + masked version with missing keywords (prefer masked regular version + over -9999 version). + """ ebuilds = { "app-text/A-1": {}, } @@ -427,3 +431,44 @@ class AutounmaskTestCase(TestCase): self.assertEqual(test_case.test_success, True, test_case.fail_msg) finally: playground.cleanup() + + + def testAutounmask9999(self): + + ebuilds = { + "dev-libs/A-1": { }, + "dev-libs/A-2": { }, + "dev-libs/A-9999": { "KEYWORDS": "" }, + "dev-libs/B-1": { "DEPEND": ">=dev-libs/A-2" }, + "dev-libs/C-1": { "DEPEND": ">=dev-libs/A-3" }, + } + + profile = { + "package.mask": + ( + ">=dev-libs/A-2", + ), + } + + test_cases = ( + ResolverPlaygroundTestCase( + ["dev-libs/B"], + success = False, + mergelist = ["dev-libs/A-2", "dev-libs/B-1"], + needed_p_mask_changes = set(["dev-libs/A-2"])), + + ResolverPlaygroundTestCase( + ["dev-libs/C"], + success = False, + mergelist = ["dev-libs/A-9999", "dev-libs/C-1"], + unstable_keywords = set(["dev-libs/A-9999"]), + needed_p_mask_changes = set(["dev-libs/A-9999"])), + ) + + 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() |