From 0c85dbb060efade7114a72db615199c88e8558d6 Mon Sep 17 00:00:00 2001 From: Sebastian Luther Date: Thu, 8 Apr 2010 07:59:15 +0200 Subject: Add --rebuilt-binaries-timestamp option This option makes emerge ignore binaries that would have been used for --rebuilt-binaries, if they are older than the given timestamp. Binaries are only reinstalled if they have a newer BUILD_TIME than the installed package (not only unequal) with this option. --- pym/_emerge/depgraph.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'pym/_emerge/depgraph.py') diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 5a7d2b761..ae7b21133 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2771,10 +2771,28 @@ class depgraph(object): # 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 + try: + built_timestamp = int(built_pkg.metadata['BUILD_TIME']) + except (KeyError, ValueError): + built_timestamp = 0 + + try: + installed_timestamp = int(inst_pkg.metadata['BUILD_TIME']) + except (KeyError, ValueError): + installed_timestamp = 0 + + if "--rebuilt-binaries-timestamp" in self._frozen_config.myopts: + minimal_timestamp = self._frozen_config.myopts["--rebuilt-binaries-timestamp"] + if built_timestamp > installed_timestamp and \ + built_timestamp >= minimal_timestamp: + return built_pkg, built_pkg + else: + #Don't care if the binary has an older BUILD_TIME than the installed + #package. This is for closely tracking a binhost. + #Use --rebuilt-binaries-timestamp 0 if you want only newer binaries + #pulled in here. + if built_timestamp != installed_timestamp: + return built_pkg, built_pkg if avoid_update: for pkg in matched_packages: -- cgit v1.2.3-1-g7c22