depgraph: avoid reinstall of identical binpkg
authorZac Medico <zmedico@gentoo.org>
Fri, 11 Feb 2011 08:57:11 +0000 (00:57 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 14 Feb 2011 04:25:00 +0000 (20:25 -0800)
This will fix bug #354441.

pym/_emerge/depgraph.py

index fe706af40508352bf0fea5b7e69983e1749b7e0c..004103c0dd2bced0c31753bae495174799ee68c6 100644 (file)
@@ -2977,6 +2977,7 @@ class depgraph(object):
                existing_node = None
                myeb = None
                rebuilt_binaries = 'rebuilt_binaries' in self._dynamic_config.myparams
+               usepkg = "--usepkg" in self._frozen_config.myopts
                usepkgonly = "--usepkgonly" in self._frozen_config.myopts
                empty = "empty" in self._dynamic_config.myparams
                selective = "selective" in self._dynamic_config.myparams
@@ -3078,6 +3079,20 @@ class depgraph(object):
                                                # to a KEYWORDS mask. See bug #252167.
 
                                                if pkg.type_name != "ebuild" and matched_packages:
+                                                       # Don't re-install a binary package that is
+                                                       # identical to the currently installed package
+                                                       # (see bug #354441).
+                                                       identical_binary = False
+                                                       if usepkg and pkg.installed:
+                                                               for selected_pkg in matched_packages:
+                                                                       if selected_pkg.type_name == "binary" and \
+                                                                               selected_pkg.cpv == pkg.cpv and \
+                                                                               selected_pkg.metadata.get('BUILD_TIME') == \
+                                                                               pkg.metadata.get('BUILD_TIME'):
+                                                                               identical_binary = True
+                                                                               break
+
+                                                       if not identical_binary:
                                                                # If the ebuild no longer exists or it's
                                                                # keywords have been dropped, reject built
                                                                # instances (installed or binary).