public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r13364 - main/trunk/pym/_emerge
@ 2009-04-19  6:03 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2009-04-19  6:03 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2009-04-19 06:03:38 +0000 (Sun, 19 Apr 2009)
New Revision: 13364

Modified:
   main/trunk/pym/_emerge/__init__.py
Log:
Fix bugs in action_deselect() and add --pretend support.


Modified: main/trunk/pym/_emerge/__init__.py
===================================================================
--- main/trunk/pym/_emerge/__init__.py	2009-04-19 05:44:22 UTC (rev 13363)
+++ main/trunk/pym/_emerge/__init__.py	2009-04-19 06:03:38 UTC (rev 13364)
@@ -14065,8 +14065,9 @@
 		writemsg_level("World set does not appear to be mutable.\n",
 			level=logging.ERROR, noiselevel=-1)
 		return 1
+	pretend = '--pretend' in opts
 	locked = False
-	if not hasattr(world_set, 'lock'):
+	if not pretend and hasattr(world_set, 'lock'):
 		world_set.lock()
 		locked = True
 	try:
@@ -14078,16 +14079,18 @@
 				# nested set
 				continue
 			for arg_atom in atoms:
-				if arg_atom.intersects(atom):
+				if arg_atom.intersects(atom) and \
+					not (arg_atom.slot and not atom.slot):
 					discard_atoms.add(atom)
-				break
+					break
 		if discard_atoms:
 			for atom in sorted(discard_atoms):
 				print ">>> Removing %s from \"world\" favorites file..." % \
 					colorize("INFORM", str(atom))
 			remaining = set(world_set)
 			remaining.difference_update(discard_atoms)
-			world_set.replace(remaining)
+			if not pretend:
+				world_set.replace(remaining)
 		else:
 			print ">>> No matching atoms found in \"world\" favorites file..."
 	finally:
@@ -16102,7 +16105,7 @@
 	if portage.secpass < 2:
 		# We've already allowed "--version" and "--help" above.
 		if "--pretend" not in myopts and myaction not in ("search","info"):
-			need_superuser = not \
+			need_superuser = myaction in ('deselect',) or not \
 				(fetchonly or \
 				(buildpkgonly and secpass >= 1) or \
 				myaction in ("metadata", "regen") or \




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-04-19  6:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-19  6:03 [gentoo-commits] portage r13364 - main/trunk/pym/_emerge Zac Medico (zmedico)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox