From 84c3c39ce28b8211b3d1ad2eeb1f5813aff857e8 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 25 May 2011 17:30:36 -0700 Subject: rebuilt-binaries: prefer newer unbuilt --- pym/_emerge/depgraph.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'pym/_emerge/depgraph.py') diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 341b3a67c..d7ddd1af0 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -3902,11 +3902,15 @@ class depgraph(object): if rebuilt_binaries: inst_pkg = None built_pkg = None + unbuilt_pkg = None for pkg in matched_packages: if pkg.installed: inst_pkg = pkg elif pkg.built: built_pkg = pkg + else: + if unbuilt_pkg is None or pkg > unbuilt_pkg: + unbuilt_pkg = pkg if built_pkg is not None and inst_pkg is not None: # Only reinstall if binary package BUILD_TIME is # non-empty, in order to avoid cases like to @@ -3922,7 +3926,9 @@ class depgraph(object): except (KeyError, ValueError): installed_timestamp = 0 - if "--rebuilt-binaries-timestamp" in self._frozen_config.myopts: + if unbuilt_pkg is not None and unbuilt_pkg > built_pkg: + pass + elif "--rebuilt-binaries-timestamp" in self._frozen_config.myopts: minimal_timestamp = self._frozen_config.myopts["--rebuilt-binaries-timestamp"] if built_timestamp and \ built_timestamp > installed_timestamp and \ -- cgit v1.2.3-1-g7c22