|
@@ -104,6 +104,11 @@ def prev_compile():
|
|
|
return False
|
|
|
|
|
|
# Python无法将字符串'false'转为布尔类型;
|
|
|
+ if 'clean' in PREV_ARG:
|
|
|
+ if type(PREV_ARG['clean']) == type(u'str'):
|
|
|
+ PREV_ARG['clean'] = True if PREV_ARG['clean'].lower() == u'true' else False
|
|
|
+ print(type(PREV_ARG['clean']), PREV_ARG['clean'])
|
|
|
+
|
|
|
if 'sync' in PREV_ARG:
|
|
|
if type(PREV_ARG['sync']) == type(u'str'):
|
|
|
PREV_ARG['sync'] = True if PREV_ARG['sync'].lower() == u'true' else False
|
|
@@ -116,31 +121,29 @@ def prev_compile():
|
|
|
|
|
|
# 更新代码;
|
|
|
commands=[]
|
|
|
+ commands.append(str.format("cd %s") % CODE_DIR)
|
|
|
+ commands.append("rm -rf Target")
|
|
|
+ # Java创建会话终端(导入了所有环境变量),无须再export,解决repo:commnand not found的问题;
|
|
|
+ #commands.append("export PATH=$(echo $PATH)")
|
|
|
+ if 'clean' in PREV_ARG and PREV_ARG['clean']:
|
|
|
+ print("enable clean")
|
|
|
+ commands.append("repo forall -c \"pwd &&git clean -xfd && git checkout --\"")
|
|
|
+
|
|
|
+ # 更新代码;
|
|
|
if 'sync' in PREV_ARG and PREV_ARG['sync']:
|
|
|
- print("start sync")
|
|
|
- # Java创建会话终端(导入了所有环境变量),无须再export,解决repo:commnand not found的问题;
|
|
|
- #commands.append("export PATH=$(echo $PATH)")
|
|
|
- commands.append(str.format("cd %s") % CODE_DIR)
|
|
|
+ print("enable sync")
|
|
|
commands.append("repo sync")
|
|
|
- commandline=';'.join(commands)
|
|
|
- cmdExecute_Ridrect(commandline, CODE_DIR)
|
|
|
|
|
|
# 重新下载;
|
|
|
- commands=[]
|
|
|
if 'redownload' in PREV_ARG and PREV_ARG['redownload']:
|
|
|
- print("start redownload")
|
|
|
- # Java创建会话终端(导入了所有环境变量),无须再export,解决repo:commnand not found的问题;
|
|
|
- #commands.append("export PATH=$(echo $PATH)")
|
|
|
- commands.append(str.format("cd %s") % CODE_DIR)
|
|
|
+ print("enable redownload")
|
|
|
commands.append(str.format("rm -rf !(%s|%s|%s|%s)") % ("builder.py", "arg.json", "51M-CompileScript.sh", "ftp.py"))
|
|
|
- # 已在编译路径中,无须处理;
|
|
|
- #commands.append(str.format("cd %s") % os.getcwd())
|
|
|
- #commands.append(str.format("mkdir %s") % CODE_FOLDER_NAME)
|
|
|
- #commands.append(str.format("cd %s") % CODE_DIR)
|
|
|
commands.append(str.format("repo init -u %s") % (PREV_ARG['branch-addr']))
|
|
|
commands.append("repo sync")
|
|
|
- commandline=';'.join(commands)
|
|
|
- cmdExecute_Ridrect(commandline)
|
|
|
+
|
|
|
+ # 执行所有命令;
|
|
|
+ commandline=';'.join(commands)
|
|
|
+ cmdExecute_Ridrect(commandline)
|
|
|
|
|
|
|
|
|
def call_script():
|