diff --git a/client/equo b/client/equo index f44fc2728..8c27c10a4 100644 --- a/client/equo +++ b/client/equo @@ -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) diff --git a/client/equoTools.py b/client/equoTools.py index 3e53f694a..e2c06aa76 100644 --- a/client/equoTools.py +++ b/client/equoTools.py @@ -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) diff --git a/libraries/entropyTools.py b/libraries/entropyTools.py index a3ee0d33f..84948da62 100644 --- a/libraries/entropyTools.py +++ b/libraries/entropyTools.py @@ -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])