public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/tests/resolver/, pym/_emerge/
Date: Wed,  4 May 2011 20:03:30 +0000 (UTC)	[thread overview]
Message-ID: <6a58b5518697cb979f9c6b0acd9337d3660e316d.zmedico@gentoo> (raw)

commit:     6a58b5518697cb979f9c6b0acd9337d3660e316d
Author:     Sebastian Luther <SebastianLuther <AT> gmx <DOT> de>
AuthorDate: Wed Apr 27 20:36:15 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed May  4 19:32:18 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6a58b551

--autounmask: Don't change masked/forced flags

This will fix bug #364701.

---
 pym/_emerge/depgraph.py                          |    6 +++-
 pym/portage/tests/resolver/ResolverPlayground.py |    2 +-
 pym/portage/tests/resolver/test_autounmask.py    |   31 +++++++++++++++++++++-
 3 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 91ec759..fabc2df 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3094,7 +3094,11 @@ class depgraph(object):
 			if required_use and check_required_use(required_use, old_use, pkg.iuse.is_valid_flag) and \
 				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)
 			if want_restart_for_use_change(pkg, new_use):
 				self._dynamic_config._need_restart = True

diff --git a/pym/portage/tests/resolver/ResolverPlayground.py b/pym/portage/tests/resolver/ResolverPlayground.py
index 709adfa..1c5d974 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 4100fbd..124abe1 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)



             reply	other threads:[~2011-05-04 20:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-04 20:03 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-05-26  6:18 [gentoo-commits] proj/portage:2.1.9 commit in: pym/portage/tests/resolver/, pym/_emerge/ Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-05-26  6:18 Zac Medico
2011-02-14  4:31 Zac Medico
2011-02-14  4:31 Zac Medico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6a58b5518697cb979f9c6b0acd9337d3660e316d.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox