Re: [gentoo-portage-dev] [PATCH] unmerge-backup: check BUILD_TIME of existing binary package (bug 586410)
On Sun, 19 Jun 2016 14:34:31 -0700 Zac Medicowrote: > 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 > --- > 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: looks fine to me, I trust it'll do the job :) -- Brian Dolbec
[gentoo-portage-dev] [PATCH] 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 --- 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: -- 2.7.4
[gentoo-portage-dev] Re: [PATCH v2] repoman: new QA error: slot operator under '||' alternative
On Sat, 18 Jun 2016 14:15:54 -0700 Zac Medicowrote: > On 06/18/2016 12:27 PM, Sergei Trofimovich wrote: > > + if in_any_of and atom.slot_operator: > > + qatracker.add_error("dependency.badslotop", > > relative_path + > > + ": %s: '%s' uses ':=' slot operator under '||' > > dep clause." % > > + (mytype, atom)) > > It should be like this: > > if in_any_of and atom.slot_operator == '=': > > Because the case of atom.slot_operator == '*' is not forbidden. Nice catch! Sent V4. -- Sergei pgpyl5mQIj5Eq.pgp Description: Цифровая подпись OpenPGP