Bug #306659 - For --rebuilt-binaries, only reinstall if binary package
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 21:14:20 +0000 (21:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 21:14:20 +0000 (21:14 -0000)
BUILD_TIME is non-empty, in order to avoid cases like to bug #306659 where
BUILD_TIME fields are missing in local and/or remote Packages file.
(trunk r15513)

svn path=/main/branches/2.1.7/; revision=15711

pym/_emerge/depgraph.py

index 2c29411867ea8f9cb46a76d0ed6313d9d129da44..b1b655ec12a1b3f9038bf613587dd5e85232389b 100644 (file)
@@ -2640,8 +2640,13 @@ class depgraph(object):
                                        elif pkg.built:
                                                built_pkg = pkg
                                if built_pkg is not None and inst_pkg is not None:
-                                       if built_pkg.metadata['BUILD_TIME'] != \
-                                               inst_pkg.metadata['BUILD_TIME']:
+                                       # Only reinstall if binary package BUILD_TIME is
+                                       # non-empty, in order to avoid cases like to
+                                       # bug #306659 where BUILD_TIME fields are missing
+                                       # in local and/or remote Packages file.
+                                       if built_pkg.metadata['BUILD_TIME'] and \
+                                               (built_pkg.metadata['BUILD_TIME'] != \
+                                               inst_pkg.metadata['BUILD_TIME']):
                                                return built_pkg, built_pkg
 
                        if avoid_update: