Fix a KeyError in emerge --info <pkg> when there is no matching ebuild in the tree...
authorZac Medico <zmedico@gentoo.org>
Wed, 22 Nov 2006 13:01:11 +0000 (13:01 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 22 Nov 2006 13:01:11 +0000 (13:01 -0000)
svn path=/main/trunk/; revision=5118

bin/emerge

index 9f3d38670d9c5294ee94f4e26e2ccd0e5a8ed045..92c5b98fe78cee9fb792bd78c6880a023f2f2af3 100755 (executable)
@@ -3792,7 +3792,13 @@ def action_info(settings, trees, myopts, myfiles):
                        valuesmap["IUSE"] = set(filter_iuse_defaults(valuesmap["IUSE"]))
                        valuesmap["USE"] = valuesmap["USE"].intersection(valuesmap["IUSE"])
                        pkgsettings.reset()
-                       pkgsettings.setcpv(pkg, mydb=portdb)
+                       # If a matching ebuild is no longer available in the tree, maybe it
+                       # would make sense to compare against the flags for the best
+                       # available version with the same slot?
+                       mydb = None
+                       if portdb.cpv_exists(pkg):
+                               mydb = portdb
+                       pkgsettings.setcpv(pkg, mydb=mydb)
                        if valuesmap["IUSE"].intersection(pkgsettings["USE"].split()) != \
                                valuesmap["USE"]:
                                diff_values["USE"] = valuesmap["USE"]