- fix for quickpkg in smartTools
- fix for atomMatch and revisions comparision - fix for possible broken text strings in database git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@848 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
+5
-1
@@ -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']:
|
||||
|
||||
+4
-5
@@ -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:
|
||||
|
||||
@@ -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):
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user