Fix --usepkg --newuse logic so that it doesn't throw a KeyError if there's no matchin...
authorZac Medico <zmedico@gentoo.org>
Wed, 18 Oct 2006 09:15:50 +0000 (09:15 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 18 Oct 2006 09:15:50 +0000 (09:15 -0000)
svn path=/main/trunk/; revision=4748

bin/emerge

index ea4162d6ca788203a9c0ee818adbb6265c15d98b..1bc29c9161c865a366b252810beeedf7a168c79a 100755 (executable)
@@ -1246,7 +1246,10 @@ class depgraph:
                                        iuses = set(filter_iuse_defaults(
                                                bindb.aux_get(myeb_pkg, ["IUSE"])[0].split()))
                                        old_use = bindb.aux_get(myeb_pkg, ["USE"])[0].split()
-                                       pkgsettings.setcpv(myeb_pkg, mydb=portdb)
+                                       mydb = None
+                                       if "--usepkgonly" not in self.myopts and myeb:
+                                               mydb = portdb
+                                       pkgsettings.setcpv(myeb, mydb=mydb)
                                        now_use = pkgsettings["USE"].split()
                                        forced_flags = set()
                                        forced_flags.update(pkgsettings.useforce)