From f2f8167e66be20181871cf484f26a6e25c13eb87 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@cd1c1023-2f26-0410-ae45-c471fc1f0318> Date: Fri, 16 Nov 2007 15:41:47 +0000 Subject: [PATCH] fix an issue with ~ dependencies and atomMatch git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@702 cd1c1023-2f26-0410-ae45-c471fc1f0318 --- libraries/databaseTools.py | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/libraries/databaseTools.py b/libraries/databaseTools.py index 570f44edf..7fdb421d4 100644 --- a/libraries/databaseTools.py +++ b/libraries/databaseTools.py @@ -2910,6 +2910,8 @@ class etpDatabase: and (matchBranches == cached['matchBranches']): return cached['result'] + print atom + # check if tag is provided -> app-foo/foo-1.2.3:SLOT|TAG or app-foo/foo-1.2.3|TAG atomTag = entropyTools.dep_gettag(atom) atomSlot = entropyTools.dep_getslot(atom) @@ -2971,9 +2973,8 @@ class etpDatabase: # IDs found in the database that match our search foundIDs = [] - - for idx in myBranchIndex: # myBranchIndex is ordered by importance - # search into the less stable, if found, break, otherwise continue + + for idx in myBranchIndex: results = self.searchPackagesByName(pkgname, sensitive = caseSensitive, branch = idx) mypkgcat = pkgcat @@ -3046,8 +3047,7 @@ class etpDatabase: else: foundIDs.append(results[0]) break - - + if (foundIDs): # now we have to handle direction if (direction) or (direction == '' and not justname) or (direction == '' and not justname and strippedAtom.endswith("*")): @@ -3083,7 +3083,7 @@ class etpDatabase: dbver = self.retrieveVersion(idpackage) if (direction == "~"): myver = entropyTools.remove_revision(dbver) - if myver == pkgversion: + if myver == pkgversion: # found dbpkginfo.append([idpackage,dbver]) else: @@ -3096,14 +3096,6 @@ class etpDatabase: if pkgversion == dbver: dbpkginfo.append([idpackage,dbver]) - if (not dbpkginfo): - # no version available - if (direction == "~"): # if the atom with the same version (any rev) is not found, fallback to the first available - for data in foundIDs: - idpackage = data[1] - dbver = self.retrieveVersion(idpackage) - dbpkginfo.append([idpackage,dbver]) - if (not dbpkginfo): dbCacheStore[etpCache['dbMatch']+self.dbname][atom] = {} dbCacheStore[etpCache['dbMatch']+self.dbname][atom]['matchSlot'] = matchSlot