add --noask to activator
git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@410 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
+23
-10
@@ -44,14 +44,25 @@ activatorLog = logTools.LogFile(level=etpConst['activatorloglevel'],filename = e
|
||||
import remoteTools
|
||||
|
||||
def sync(options, justTidy = False):
|
||||
|
||||
|
||||
activatorRequestNoAsk = False
|
||||
myopts = []
|
||||
for i in options:
|
||||
if ( i == "--noask" ):
|
||||
activatorRequestNoAsk = True
|
||||
else:
|
||||
myopts.append(i)
|
||||
options = myopts
|
||||
|
||||
activatorLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_VERBOSE,"sync: called with justTidy -> "+str(justTidy))
|
||||
|
||||
print_info(green(" * ")+red("Starting to sync data across mirrors (packages/database) ..."))
|
||||
|
||||
if (not justTidy):
|
||||
# firstly sync the packages
|
||||
rc = packages([ "sync" , "--ask" ])
|
||||
if (activatorRequestNoAsk):
|
||||
rc = packages([ "sync" ])
|
||||
else:
|
||||
rc = packages([ "sync" , "--ask" ])
|
||||
# then sync the database, if the packages sync completed successfully
|
||||
if (rc == False):
|
||||
sys.exit(401)
|
||||
@@ -62,10 +73,11 @@ def sync(options, justTidy = False):
|
||||
import databaseTools
|
||||
databaseTools.database(['md5check'])
|
||||
time.sleep(2)
|
||||
# ask question
|
||||
rc = askquestion(" Should I continue with the tidy procedure ?")
|
||||
if rc == "No":
|
||||
sys.exit(0)
|
||||
if (not activatorRequestNoAsk):
|
||||
# ask question
|
||||
rc = askquestion(" Should I continue with the tidy procedure ?")
|
||||
if rc == "No":
|
||||
sys.exit(0)
|
||||
|
||||
print_info(green(" * ")+red("Starting to collect packages that would be removed from the repository ..."), back = True)
|
||||
|
||||
@@ -103,9 +115,10 @@ def sync(options, justTidy = False):
|
||||
print_info(green("\t* ")+yellow(file))
|
||||
|
||||
# ask question
|
||||
rc = askquestion(" Would you like to continue ?")
|
||||
if rc == "No":
|
||||
sys.exit(0)
|
||||
if (not activatorRequestNoAsk):
|
||||
rc = askquestion(" Would you like to continue ?")
|
||||
if rc == "No":
|
||||
sys.exit(0)
|
||||
|
||||
# remove them!
|
||||
activatorLog.log(ETP_LOGPRI_INFO,ETP_LOGLEVEL_NORMAL,"sync: starting to remove packages from mirrors.")
|
||||
|
||||
Vendored
+1
@@ -45,6 +45,7 @@ def print_help():
|
||||
print_info(" --nocolor\t\tdisable colorized output")
|
||||
print_info(blue("Tools available: "))
|
||||
print_info(" \t"+green(bold("sync"))+yellow("\t\t to sync packages, database and also do some tidy"))
|
||||
print_info(" \t\t"+red("--noask")+"\t\t\t do not make any question")
|
||||
print_info(" \t"+green(bold("tidy"))+yellow("\t\t to just remove binary packages that are not in the Entropy database anymore"))
|
||||
print_info(" \t"+green(bold("packages"))+yellow("\t to manage binary packages"))
|
||||
print_info(" \t\t"+red("--ask")+"\t\t\t ask before making any changes")
|
||||
|
||||
Reference in New Issue
Block a user