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

Author: zmedico
Date: 2008-05-24 22:03:27 +0000 (Sat, 24 May 2008)
New Revision: 10394

Modified:
   main/trunk/pym/portage/__init__.py
Log:
For dep_expand() backward compatibility, handle atoms with missing '='
prefix which did not raise an error here before the portage.dep.Atom
class was introduced.


Modified: main/trunk/pym/portage/__init__.py
===================================================================
--- main/trunk/pym/portage/__init__.py	2008-05-24 21:33:12 UTC (rev 10393)
+++ main/trunk/pym/portage/__init__.py	2008-05-24 22:03:27 UTC (rev 10394)
@@ -5720,8 +5720,15 @@
 	myindex = orig_dep.index(mydep)
 	prefix = orig_dep[:myindex]
 	postfix = orig_dep[myindex+len(mydep):]
-	return portage.dep.Atom(prefix + cpv_expand(
-		mydep, mydb=mydb, use_cache=use_cache, settings=settings) + postfix)
+	expanded = cpv_expand(mydep, mydb=mydb,
+		use_cache=use_cache, settings=settings)
+	try:
+		return portage.dep.Atom(prefix + expanded + postfix)
+	except portage.exception.InvalidAtom:
+		# Missing '=' prefix is allowed for backward compatibility.
+		if not isvalidatom("=" + prefix + expanded + postfix):
+			raise
+		return portage.dep.Atom("=" + prefix + expanded + postfix)
 
 def dep_check(depstring, mydbapi, mysettings, use="yes", mode=None, myuse=None,
 	use_cache=1, use_binaries=0, myroot="/", trees=None):

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



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

only message in thread, other threads:[~2008-05-24 22:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-24 22:03 [gentoo-commits] portage r10394 - main/trunk/pym/portage 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