more stabilization work

git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@519 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
(no author)
2007-09-25 21:56:48 +00:00
parent be8f5eb165
commit 76b650ca10
3 changed files with 25 additions and 13 deletions
+15 -3
View File
@@ -123,11 +123,23 @@ try:
elif (options[0] == "install") or (options[0] == "remove") or (options[0] == "deptest") or (options[0] == "world"):
if options[0] == "install":
entropyTools.applicationLockCheck("install")
cr = entropyTools.applicationLockCheck("install", gentle = True)
if (cr):
print_warning(red("Running with ")+bold("--pretend")+red("..."))
if "--pretend" not in options:
options.append("--pretend")
elif options[0] == "remove":
entropyTools.applicationLockCheck("remove")
cr = entropyTools.applicationLockCheck("remove", gentle = True)
if (cr):
print_warning(red("Running with ")+bold("--pretend")+red("..."))
if "--pretend" not in options:
options.append("--pretend")
elif options[0] == "world":
entropyTools.applicationLockCheck("remove")
cr = entropyTools.applicationLockCheck("world", gentle = True)
if (cr):
print_warning(red("Running with ")+bold("--pretend")+red("..."))
if "--pretend" not in options:
options.append("--pretend")
rc = equoTools.package(options)
sys.exit(rc)
+4 -8
View File
@@ -655,7 +655,7 @@ def filterSatisfiedDependencies(dependencies, deepdeps = False):
'''
def generateDependencyTree(atomInfo, emptydeps = False, deepdeps = False):
print ":::: enter ::::"
#print ":::: enter ::::"
treecache = {}
unsatisfiedDeps = getDependencies(atomInfo)
@@ -699,10 +699,10 @@ def generateDependencyTree(atomInfo, emptydeps = False, deepdeps = False):
treecache[undep] = True
if (not tree[treedepth]):
print darkgreen("satisfied: ")+str(tree[treedepth])
#print darkgreen("satisfied: ")+str(tree[treedepth])
break
else:
print red("not satisfied: ")+str(tree[treedepth])
#print red("not satisfied: ")+str(tree[treedepth])
# cycle again, load unsatisfiedDeps
unsatisfiedDeps = []
for dep in tree[treedepth]:
@@ -1645,7 +1645,6 @@ def printPackageInfo(idpackage, dbconn, clientSearch = False, strictOutput = Fal
clientDbconn = openClientDatabase()
if (clientDbconn != -1):
pkginstalled = clientDbconn.atomMatch(dep_getkey(pkgatom), matchSlot = pkgslot)
print pkginstalled
if (pkginstalled[1] == 0):
idx = pkginstalled[0]
# found
@@ -1730,7 +1729,6 @@ def worldUpdate(ask = False, pretend = False, verbose = False, onlyfetch = False
if (not upgrade):
branches = [etpConst['branch']]
print "NOT YET IMPLEMENTED: update function not working, try adding 'upgrade' to the opts"
else:
branches = etpConst['branches']
# FIXME: handle ask, pretend, verbose, onlyfetch
@@ -1951,7 +1949,7 @@ def installPackages(packages = [], atomsdata = [], ask = False, pretend = False,
if (runQueue):
if (ask or pretend):
print_info(red(" @@ ")+blue("These are the packages that would be merged:"))
print_info(red(" @@ ")+blue("These are the packages that would be ")+bold("merged:"))
for packageInfo in runQueue:
try:
dbconn = openRepositoryDatabase(packageInfo[1])
@@ -2000,8 +1998,6 @@ def installPackages(packages = [], atomsdata = [], ask = False, pretend = False,
idx = pkginstalled[0]
installedVer = clientDbconn.retrieveVersion(idx)
installedTag = clientDbconn.retrieveVersionTag(idx)
if not installedTag:
installedTag = "NoTag"
installedRev = clientDbconn.retrieveRevision(idx)
actionQueue[pkgatom]['remove'] = idx
actionQueue[pkgatom]['removeatom'] = clientDbconn.retrieveAtom(idx)
+6 -2
View File
@@ -56,11 +56,15 @@ def isRoot():
return True
return False
def applicationLockCheck(option = None):
def applicationLockCheck(option = None, gentle = False):
if (etpConst['applicationlock']):
print_error(red("Another instance of Equo is running. Action: ")+bold(str(option))+red(" denied."))
print_error(red("If I am lying (maybe). Please remove ")+bold(etpConst['pidfile']))
sys.exit(10)
if (not gentle):
sys.exit(10)
else:
return True
return False
def getRandomNumber():
return int(str(random.random())[2:7])