diff --git a/client/equo b/client/equo index b57576c38..d095e5039 100644 --- a/client/equo +++ b/client/equo @@ -199,7 +199,11 @@ def writeerrorstatus(status): def loadconfcache(): if not etpUi['quiet']: print_info(red(" @@ ")+blue("Caching equo conf"), back = True) import confTools - scandata = confTools.scanfs(dcache = True) + try: + scandata = confTools.scanfs(dcache = True) + except: # FIXME: create specific exception, client database does not exist + if not etpUi['quiet']: print_info(red(" @@ ")+blue("Caching not run.")) + return if not etpUi['quiet']: print_info(red(" @@ ")+blue("Caching complete.")) if len(scandata) > 0: if not etpUi['quiet']: diff --git a/client/equoTools.py b/client/equoTools.py index ab6bc496f..5a9b124c8 100644 --- a/client/equoTools.py +++ b/client/equoTools.py @@ -115,13 +115,12 @@ def atomMatch(atom, caseSentitive = True, matchSlot = None, matchBranches = (), if xcache: cached = atomMatchCache.get(atom) if cached: - if (cached['matchSlot'] == matchSlot) and (cached['matchBranches'] == matchBranches) and (cached['etpRepositories'] == matchBranches): + if (cached['matchSlot'] == matchSlot) and (cached['matchBranches'] == matchBranches) and (cached['etpRepositories'] == etpRepositories): return cached['result'] repoResults = {} exitstatus = 0 exitErrors = {} - for repo in etpRepositories: # sync database if not available rc = fetchRepositoryIfNotAvailable(repo) @@ -134,6 +133,7 @@ def atomMatch(atom, caseSentitive = True, matchSlot = None, matchBranches = (), # search query = dbconn.atomMatch(atom, caseSensitive = caseSentitive, matchSlot = matchSlot, matchBranches = matchBranches) + #print "repo:",repo,"atom:",atom,"result:",query if query[1] == 0: # package found, add to our dictionary repoResults[repo] = query[0] @@ -243,8 +243,7 @@ def atomMatch(atom, caseSentitive = True, matchSlot = None, matchBranches = (), revisions = [] for repo in conflictingTags: revisions.append(str(conflictingTags[repo]['revision'])) - newerRevision = getNewerVersionTag(revisions) - newerRevision = newerRevision[0] + newerRevision = max(revisions) duplicatedRevisions = extractDuplicatedEntries(revisions) needFiltering = False if newerRevision in duplicatedRevisions: @@ -494,7 +493,6 @@ def generateDependencyTree(atomInfo, emptydeps = False, deepdeps = False, usefil deptree.add((1,atomInfo)) clientDbconn = openClientDatabase() - while mydep != None: # already analyzed in this call @@ -522,6 +520,7 @@ def generateDependencyTree(atomInfo, emptydeps = False, deepdeps = False, usefil matchatom = matchdb.retrieveAtom(match[0]) matchdb.closeDB() if matchatom in treecache: + print matchatom mydep = mybuffer.pop() continue else: diff --git a/libraries/databaseTools.py b/libraries/databaseTools.py index 64179007f..a6090fb19 100644 --- a/libraries/databaseTools.py +++ b/libraries/databaseTools.py @@ -309,6 +309,8 @@ class etpDatabase: self.connection = sqlite.connect(dbFile,timeout=300.0) self.cursor = self.connection.cursor() + # fix for queries that contain weird text + self.connection.text_factory = lambda x: unicode(x, "utf-8", "ignore") def closeDB(self): diff --git a/libraries/smartTools.py b/libraries/smartTools.py index f8ad505b1..5ebfcfc9d 100644 --- a/libraries/smartTools.py +++ b/libraries/smartTools.py @@ -60,7 +60,7 @@ def smart(options): elif (options[0] == "package"): rc = smartPackagesHandler(options[1:]) elif (options[0] == "quickpkg"): - rc = QuickpkgHandler(options[1:], savedir = savedir) + rc = QuickpkgHandler(options[1:], savedir = smartRequestSavedir) elif (options[0] == "inflate") or (options[0] == "deflate") or (options[0] == "extract"): rc = CommonFlate(options[1:], action = options[0], savedir = smartRequestSavedir) else: