From 5d96649ac61ab51295b125b0dae33312fc009024 Mon Sep 17 00:00:00 2001
From: Zac Medico <zmedico@gentoo.org>
Date: Sat, 16 Dec 2006 21:42:07 +0000
Subject: [PATCH] Make dep_check validate all depstring atoms in order to
 prevent problems from occuring later due to unexpected invalid atoms.

svn path=/main/trunk/; revision=5304
---
 bin/emerge     | 1 +
 pym/portage.py | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/bin/emerge b/bin/emerge
index d5e136feb..771e61a99 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1328,6 +1328,7 @@ class depgraph:
 
 		if not mycheck[0]:
 			sys.stderr.write("\n\n%s\n\n" % mycheck[1])
+			sys.stderr.write("Parent: %s\n\n" % str(myparent))
 			sys.stderr.write("%s\n\n" % depstring)
 			return 0
 		mymerge = mycheck[1]
diff --git a/pym/portage.py b/pym/portage.py
index 22e6455d6..0f1ba998f 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -3647,6 +3647,9 @@ 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 not isvalidatom(x, allow_blockers=True):
+			raise portage_exception.ParseError(
+				"invalid atom: '%s'" % x)
 		mykey = dep_getkey(x)
 		if not mykey.startswith("virtual/"):
 			newsplit.append(x)
-- 
2.26.2