For bug #165382, show a helpful message if an exception is raised from cpv_expand...
authorZac Medico <zmedico@gentoo.org>
Mon, 5 Feb 2007 21:27:10 +0000 (21:27 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 5 Feb 2007 21:27:10 +0000 (21:27 -0000)
svn path=/main/branches/2.1.2/; revision=5898

bin/emerge

index cabf9e9afeccd4e9d93f394424c3204162a06baf..af9362abe836063ca971cde0ae8c822c1cd7163b 100755 (executable)
@@ -1803,9 +1803,22 @@ class depgraph:
                                                # dep_wordreduce and dep_eval calls.
                                                try:
                                                        portage_dep._dep_check_strict = False
-                                                       success, atoms = portage.dep_check(depstr,
-                                                               final_db, pkgsettings, myuse=myuse,
-                                                               trees=dep_check_trees, myroot=myroot)
+                                                       try:
+                                                               success, atoms = portage.dep_check(depstr,
+                                                                       final_db, pkgsettings, myuse=myuse,
+                                                                       trees=dep_check_trees, myroot=myroot)
+                                                       except Exception, e:
+                                                               if isinstance(e, SystemExit):
+                                                                       raise
+                                                               # This is helpful, for example, if a ValueError
+                                                               # is thrown from cpv_expand due to multiple
+                                                               # matches (this can happen if an atom lacks a
+                                                               # category).
+                                                               show_invalid_depstring_notice(
+                                                                       ("installed", myroot, pkg, "nomerge"),
+                                                                       depstr, str(e))
+                                                               del e
+                                                               raise
                                                finally:
                                                        portage_dep._dep_check_strict = True
                                                if not success: