- fixed a bug in generate_dependency_tree() which pulled in duplicated packages in certain circumstances
- added information about packages switching from a repository to another git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@1232 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
+23
-4
@@ -293,12 +293,14 @@ def installPackages(packages = [], atomsdata = [], deps = True, emptydeps = Fals
|
||||
installedVer = "Not installed"
|
||||
installedTag = "NoTag"
|
||||
installedRev = "NoRev"
|
||||
installedRepo = "Not available"
|
||||
pkginstalled = Equo.clientDbconn.atomMatch(Equo.entropyTools.dep_getkey(pkgatom), matchSlot = pkgslot)
|
||||
if (pkginstalled[1] == 0):
|
||||
# found
|
||||
idx = pkginstalled[0]
|
||||
installedVer = Equo.clientDbconn.retrieveVersion(idx)
|
||||
installedTag = Equo.clientDbconn.retrieveVersionTag(idx)
|
||||
installedRepo = Equo.clientDbconn.retrievePackageFromInstalledTable(idx)
|
||||
if not installedTag:
|
||||
installedTag = "NoTag"
|
||||
installedRev = Equo.clientDbconn.retrieveRevision(idx)
|
||||
@@ -312,7 +314,10 @@ def installPackages(packages = [], atomsdata = [], deps = True, emptydeps = Fals
|
||||
installedRev = 0
|
||||
pkgcmp = Equo.entropyTools.entropyCompareVersions((pkgver,pkgtag,pkgrev),(installedVer,installedTag,installedRev))
|
||||
if (pkgcmp == 0):
|
||||
action = darkgreen("Reinstall")
|
||||
if installedRepo != reponame:
|
||||
action = darkgreen("Reinstall")+" | Switch repo: "+blue(installedRepo)+" ===> "+darkgreen(reponame)
|
||||
else:
|
||||
action = darkgreen("Reinstall")
|
||||
elif (pkgcmp > 0):
|
||||
if (installedVer == "0"):
|
||||
action = darkgreen("Install")
|
||||
@@ -404,6 +409,7 @@ def installPackages(packages = [], atomsdata = [], deps = True, emptydeps = Fals
|
||||
installedVer = '0'
|
||||
installedTag = ''
|
||||
installedRev = 0
|
||||
installedRepo = 'Not available'
|
||||
pkginstalled = Equo.clientDbconn.atomMatch(Equo.entropyTools.dep_getkey(pkgatom), matchSlot = pkgslot)
|
||||
if (pkginstalled[1] == 0):
|
||||
# found an installed package
|
||||
@@ -411,13 +417,20 @@ def installPackages(packages = [], atomsdata = [], deps = True, emptydeps = Fals
|
||||
installedVer = Equo.clientDbconn.retrieveVersion(idx)
|
||||
installedTag = Equo.clientDbconn.retrieveVersionTag(idx)
|
||||
installedRev = Equo.clientDbconn.retrieveRevision(idx)
|
||||
installedRepo = Equo.clientDbconn.retrievePackageFromInstalledTable(idx)
|
||||
onDiskFreedSize += Equo.clientDbconn.retrieveOnDiskSize(idx)
|
||||
|
||||
if not (etpUi['ask'] or etpUi['pretend'] or etpUi['verbose']):
|
||||
continue
|
||||
|
||||
action = 0
|
||||
flags = " ["
|
||||
repoSwitch = False
|
||||
if packageInfo[1] != installedRepo:
|
||||
repoSwitch = True
|
||||
if repoSwitch:
|
||||
flags = darkred(" [")
|
||||
else:
|
||||
flags = " ["
|
||||
pkgcmp = Equo.entropyTools.entropyCompareVersions((pkgver,pkgtag,pkgrev),(installedVer,installedTag,installedRev))
|
||||
if (pkgcmp == 0):
|
||||
pkgsToReinstall += 1
|
||||
@@ -435,9 +448,15 @@ def installPackages(packages = [], atomsdata = [], deps = True, emptydeps = Fals
|
||||
pkgsToDowngrade += 1
|
||||
flags += darkblue("D")
|
||||
action = -1
|
||||
flags += "] "
|
||||
if repoSwitch:
|
||||
flags += darkred("] ")
|
||||
else:
|
||||
flags += "] "
|
||||
|
||||
repoinfo = "["+brown(packageInfo[1])+"] "
|
||||
if repoSwitch:
|
||||
repoinfo = "["+brown(installedRepo)+"->"+darkred(packageInfo[1])+"] "
|
||||
else:
|
||||
repoinfo = "["+brown(packageInfo[1])+"] "
|
||||
oldinfo = ''
|
||||
if action != 0:
|
||||
oldinfo = " ["+blue(installedVer)+"|"+red(str(installedRev))
|
||||
|
||||
@@ -1132,11 +1132,13 @@ class EquoInterface(TextInterface):
|
||||
|
||||
mydbconn = self.openRepositoryDatabase(atomInfo[1])
|
||||
myatom = mydbconn.retrieveAtom(atomInfo[0])
|
||||
mykey, myslot = mydbconn.retrieveKeySlot(atomInfo[0])
|
||||
|
||||
# caches
|
||||
treecache = set()
|
||||
matchcache = set()
|
||||
keyslotcache = set()
|
||||
keyslotcache.add((myslot,mykey))
|
||||
# special events
|
||||
dependenciesNotFound = set()
|
||||
conflicts = set()
|
||||
@@ -1158,7 +1160,6 @@ class EquoInterface(TextInterface):
|
||||
while mydep != None:
|
||||
|
||||
# already analyzed in this call
|
||||
|
||||
if mydep[1] in treecache:
|
||||
mydep = mybuffer.pop()
|
||||
continue
|
||||
@@ -1181,7 +1182,7 @@ class EquoInterface(TextInterface):
|
||||
# check if atom has been already pulled in
|
||||
matchdb = self.openRepositoryDatabase(match[1])
|
||||
matchatom = matchdb.retrieveAtom(match[0])
|
||||
matchslot = matchdb.retrieveSlot(match[0]) # used later
|
||||
matchkey, matchslot = matchdb.retrieveKeySlot(match[0])
|
||||
if matchatom in treecache:
|
||||
mydep = mybuffer.pop()
|
||||
continue
|
||||
@@ -1191,12 +1192,12 @@ class EquoInterface(TextInterface):
|
||||
treecache.add(mydep[1])
|
||||
|
||||
# check if key + slot has been already pulled in
|
||||
key = self.entropyTools.dep_getkey(matchatom)
|
||||
if (matchslot,key) in keyslotcache:
|
||||
print "keyslotcache",matchslot, matchkey
|
||||
if (matchslot,matchkey) in keyslotcache:
|
||||
mydep = mybuffer.pop()
|
||||
continue
|
||||
else:
|
||||
keyslotcache.add((matchslot,key))
|
||||
keyslotcache.add((matchslot,matchkey))
|
||||
|
||||
# already analyzed by the calling function
|
||||
if usefilter:
|
||||
@@ -1217,7 +1218,7 @@ class EquoInterface(TextInterface):
|
||||
deptree.add((mydep[0],match)) # add match
|
||||
|
||||
# extra library breakages check
|
||||
clientmatch = self.clientDbconn.atomMatch(key, matchSlot = matchslot)
|
||||
clientmatch = self.clientDbconn.atomMatch(matchkey, matchSlot = matchslot)
|
||||
if clientmatch[0] != -1:
|
||||
broken_atoms = self.__lookup_library_breakages(match, clientmatch, deep_deps = deep_deps)
|
||||
for x in broken_atoms:
|
||||
|
||||
Reference in New Issue
Block a user