Create Atom instances when validating atoms inside _expand_new_virtuals().
authorZac Medico <zmedico@gentoo.org>
Sun, 25 May 2008 05:12:46 +0000 (05:12 -0000)
committerZac Medico <zmedico@gentoo.org>
Sun, 25 May 2008 05:12:46 +0000 (05:12 -0000)
(trunk r10396)

svn path=/main/branches/2.1.2/; revision=10412

pym/portage.py

index 768da9b1421587a090fba139aa3f3e1c1b67ab8b..2bcbd4e0712556786ff5332c22c98104fda19884 100644 (file)
@@ -5416,10 +5416,15 @@ def _expand_new_virtuals(mysplit, edebug, mydbapi, mysettings, myroot="/",
                        newsplit.append(_expand_new_virtuals(x, edebug, mydbapi,
                                mysettings, myroot=myroot, trees=trees, **kwargs))
                        continue
-               if portage_dep._dep_check_strict and \
-                       not isvalidatom(x, allow_blockers=True):
-                       raise portage_exception.ParseError(
-                               "invalid atom: '%s'" % x)
+
+               if not isinstance(x, portage_dep.Atom):
+                       try:
+                               x = portage_dep.Atom(x)
+                       except portage_exception.InvalidAtom:
+                               if portage_dep._dep_check_strict:
+                                       raise portage_exception.ParseError(
+                                               "invalid atom: '%s'" % x)
+
                mykey = dep_getkey(x)
                if not mykey.startswith("virtual/"):
                        newsplit.append(x)