commit: 3d5382f3e2c437285a009db356c719bc3d77bdd9 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Sun Jun 19 21:32:32 2016 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Sun Jun 19 22:17:13 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=3d5382f3
unmerge-backup: check BUILD_TIME of existing binary package (bug 586410) Fix the dblink._quickpkg_dblink method to search for a binary package having identical BUILD_TIME to the installed instance. X-Gentoo-Bug: 586410 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=586410 Acked-by: Brian Dolbec <dolsen <AT> gentoo.org> pym/portage/dbapi/vartree.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index bfbe356..28ae584 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -5231,12 +5231,19 @@ class dblink(object): def _quickpkg_dblink(self, backup_dblink, background, logfile): + build_time = backup_dblink.getfile('BUILD_TIME') + try: + build_time = long(build_time.strip()) + except ValueError: + build_time = 0 + trees = QueryCommand.get_db()[self.settings["EROOT"]] bintree = trees["bintree"] - binpkg_path = bintree.getname(backup_dblink.mycpv) - if os.path.exists(binpkg_path) and \ - catsplit(backup_dblink.mycpv)[1] not in bintree.invalids: - return os.EX_OK + + for binpkg in reversed( + bintree.dbapi.match('={}'.format(backup_dblink.mycpv))): + if binpkg.build_time == build_time: + return os.EX_OK self.lockdb() try:
