Fix package selection logic to always properly reject the installed package
authorZac Medico <zmedico@gentoo.org>
Mon, 31 Mar 2008 21:08:10 +0000 (21:08 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 31 Mar 2008 21:08:10 +0000 (21:08 -0000)
when another is available and the user wants to reinstall. (trunk r9652)

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

bin/emerge

index d912176b604340ee2398cf28e93316facd11d4bd..f9ea202a16f495c27b6f4c628ac2b1ab73b78b82 100755 (executable)
@@ -2353,8 +2353,10 @@ class depgraph:
                                                cpv=cpv, metadata=metadata,
                                                built=built, installed=installed,
                                                onlydeps=onlydeps)
-                                       if installed and want_reinstall:
-                                               matched_packages.insert(0, pkg)
+                                       if installed and want_reinstall and matched_packages:
+                                               # Reject the installed package unless
+                                               # there are no other matches.
+                                               break
                                        else:
                                                matched_packages.append(pkg)
                                        if reinstall_for_flags: