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

svn path=/main/trunk/; revision=9652

pym/_emerge/__init__.py

index e9d0fe7fddf3ff0269c05f6bf324245d6a2941ff..fa7950d4d3d9e63f9d831c2ad76e0b5e0e0b3979 100644 (file)
@@ -2706,8 +2706,10 @@ class depgraph(object):
                                                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: