public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] portage r10517 - in main/branches/2.1.2: bin pym
@ 2008-05-31  9:17 Zac Medico (zmedico)
  0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-05-31  9:17 UTC (permalink / raw
  To: gentoo-commits

Author: zmedico
Date: 2008-05-31 09:17:07 +0000 (Sat, 31 May 2008)
New Revision: 10517

Modified:
   main/branches/2.1.2/bin/emerge
   main/branches/2.1.2/pym/portage_dep.py
Log:
* Tweak isvalidatom() to treat "null" category as valid, but missing category
  as invalid (previously both where treated as invalid).

* Fix a spot inside emerge's unmerge() function that sometimes generates
  invalid atoms by adding an unnecessary "=" to the front. Even when in
  cases that resulted in a valid atom here, adding the "=" was redundant
  because dep_expand() does that automatically now (for backward compat).
(trunk r10516)


Modified: main/branches/2.1.2/bin/emerge
===================================================================
--- main/branches/2.1.2/bin/emerge	2008-05-31 09:11:25 UTC (rev 10516)
+++ main/branches/2.1.2/bin/emerge	2008-05-31 09:17:07 UTC (rev 10517)
@@ -6510,8 +6510,7 @@
 				sys.exit(1)
 	
 			if not mymatch and x[0] not in "<>=~":
-				#add a "=" if missing
-				mymatch=localtree.dep_match("="+x)
+				mymatch = localtree.dep_match(x)
 			if not mymatch:
 				portage.writemsg("\n--- Couldn't find '%s' to %s.\n" % \
 					(x, unmerge_action), noiselevel=-1)

Modified: main/branches/2.1.2/pym/portage_dep.py
===================================================================
--- main/branches/2.1.2/pym/portage_dep.py	2008-05-31 09:11:25 UTC (rev 10516)
+++ main/branches/2.1.2/pym/portage_dep.py	2008-05-31 09:17:07 UTC (rev 10517)
@@ -433,19 +433,30 @@
 	if allow_blockers and atom.startswith("!"):
 		atom = atom[1:]
 	cpv = dep_getcpv(atom)
+	cpv_catsplit = catsplit(cpv)
+	mycpv_cps = None
 	if cpv:
-		if _valid_category.match(catsplit(cpv)[0]) is None:
-			return 0
-		mycpv_cps = catpkgsplit(cpv)
-	else:
-		mycpv_cps = None
+		if len(cpv_catsplit) == 2:
+			if _valid_category.match(cpv_catsplit[0]) is None:
+				return 0
+			if cpv_catsplit[0] == "null":
+				# "null" category is valid, missing category is not.
+				mycpv_cps = catpkgsplit(cpv.replace("null/", "cat/", 1))
+				if mycpv_cps:
+					mycpv_cps[0] = "null"
+		if not mycpv_cps:
+			mycpv_cps = catpkgsplit(cpv)
+
 	operator = get_operator(atom)
 	if operator:
 		if operator[0] in "<>" and remove_slot(atom).endswith("*"):
 			return 0
-		if mycpv_cps and mycpv_cps[0] != "null":
-			# >=cat/pkg-1.0
-			return 1
+		if mycpv_cps:
+			if len(cpv_catsplit) == 2:
+				# >=cat/pkg-1.0
+				return 1
+			else:
+				return 0
 		else:
 			# >=cat/pkg or >=pkg-1.0 (no category)
 			return 0
@@ -453,7 +464,7 @@
 		# cat/pkg-1.0
 		return 0
 
-	if (len(atom.split('/')) == 2):
+	if len(cpv_catsplit) == 2:
 		# cat/pkg
 		return 1
 	else:

-- 
gentoo-commits@lists.gentoo.org mailing list



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

only message in thread, other threads:[~2008-05-31  9:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-31  9:17 [gentoo-commits] portage r10517 - in main/branches/2.1.2: bin pym 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