- fixed an issue with removalQueue "equo remove"

- fixed an issue that could cause to pull in system packages

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@758 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
(no author)
2007-11-23 14:25:58 +00:00
parent b4d0c50450
commit 9f07782cdc
2 changed files with 20 additions and 26 deletions
+5 -4
View File
@@ -961,8 +961,8 @@ def removePackage(infoDict):
if etpConst['collisionprotect'] > 0:
if clientDbconn.isFileAvailable(file) and os.path.isfile(file): # in this way we filter out directories
print_warning(darkred(" ## ")+red("Collision found during remove for ")+file+red(" - cannot overwrite"))
equoLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_NORMAL,"Collision found during remove for "+file+" - cannot overwrite")
print_warning(darkred(" ## ")+red("Collision found during remove of ")+file+red(" - cannot overwrite"))
equoLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_NORMAL,"Collision found during remove of "+file+" - cannot overwrite")
continue
protected = False
@@ -1172,12 +1172,13 @@ def installPackage(infoDict):
# request new tofile then
if (protected):
if tofile not in etpConst['configprotectskip']:
oldtofile = tofile
tofile, prot_status = allocateMaskedFile(tofile, fromfile)
if not prot_status:
protected = False
else:
equoLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_NORMAL,"Protecting config file: "+tofile)
print_warning(darkred(" ## ")+red("Protecting config file: ")+tofile)
equoLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_NORMAL,"Protecting config file: "+oldtofile)
print_warning(darkred(" ## ")+red("Protecting config file: ")+oldtofile)
else:
equoLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_NORMAL,"Skipping config file installation, as stated in equo.conf: "+tofile)
print_warning(darkred(" ## ")+red("Skipping file installation: ")+tofile)
+15 -22
View File
@@ -914,7 +914,7 @@ def removePackages(packages = [], atomsdata = [], ask = False, pretend = False,
choosenRemovalQueue.append(y)
if (choosenRemovalQueue):
print_info(red(" @@ ")+blue("These are the packages that would be added to the removal queue:"))
print_info(red(" @@ ")+blue("This is the new removal queue:"))
totalatoms = str(len(choosenRemovalQueue))
atomscounter = 0
@@ -927,30 +927,23 @@ def removePackages(packages = [], atomsdata = [], ask = False, pretend = False,
while len(stratomscounter) < len(totalatoms):
stratomscounter = " "+stratomscounter
print_info(" # "+red("(")+bold(stratomscounter)+"/"+blue(str(totalatoms))+red(")")+repositoryInfo+" "+blue(rematom))
if (ask):
rc = entropyTools.askquestion(" Would you like to add these packages to the removal queue?")
if rc != "No":
print_info(red(" @@ ")+blue("Removal Queue updated."))
for x in choosenRemovalQueue:
removalQueue.append(x)
else:
for x in choosenRemovalQueue:
removalQueue.append(x)
for x in choosenRemovalQueue:
removalQueue.append(x)
else:
writechar("\n")
if (ask):
if (deps):
rc = entropyTools.askquestion(" I am going to start the removal. Are you sure?")
if rc == "No":
clientDbconn.closeDB()
return 0,0
else:
if (deps):
entropyTools.countdown(what = red(" @@ ")+blue("Starting removal in "),back = True)
for idpackage in plainRemovalQueue:
removalQueue.append(idpackage)
rc = entropyTools.askquestion(" Would you like to proceed?")
if rc == "No":
clientDbconn.closeDB()
return 0,0
elif (deps):
entropyTools.countdown(what = red(" @@ ")+blue("Starting removal in "),back = True)
for idpackage in plainRemovalQueue: # append at the end requested packages if not in queue
if idpackage not in removalQueue:
removalQueue.append(idpackage)
# clear old resume information
dumpTools.dumpobj(etpCache['remove'],{})