Fix work with temp directories

This commit is contained in:
Oleg.Korshul
2021-02-02 12:18:05 +03:00
parent 89061f939e
commit e16341be8b
2 changed files with 9 additions and 3 deletions

View File

@ -307,6 +307,12 @@ def cmd_in_dir(directory, prog, args=[], is_no_errors=False):
os.chdir(cur_dir)
return ret
def cmd_and_return_cwd(prog, args=[], is_no_errors=False):
cur_dir = os.getcwd()
ret = cmd(prog, args, is_no_errors)
os.chdir(cur_dir)
return ret
def run_command(sCommand):
popen = subprocess.Popen(sCommand, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
result = {'stdout' : '', 'stderr' : ''}

View File

@ -62,9 +62,9 @@ def make_pro_file(makefiles_dir, pro_file):
base.delete_file(makefiles_dir + "/build.makefile_" + file_suff)
base.cmd(qt_dir + "/bin/qmake", ["-nocache", pro_file, "CONFIG+=" + config_param] + qmake_addon)
if ("1" == config.option("clean")):
base.cmd_in_dir(makefiles_dir, base.app_make(), ["clean", "-f", "./build.makefile_" + file_suff], True)
base.cmd_in_dir(makefiles_dir, base.app_make(), ["distclean", "-f", "./build.makefile_" + file_suff], True)
base.cmd_in_dir(makefiles_dir, base.app_make(), ["-f", "./build.makefile_" + file_suff])
base.cmd_and_return_cwd(base.app_make(), ["clean", "-f", makefiles_dir + "/build.makefile_" + file_suff], True)
base.cmd_and_return_cwd(base.app_make(), ["distclean", "-f", makefiles_dir + "/build.makefile_" + file_suff], True)
base.cmd_and_return_cwd(base.app_make(), ["-f", makefiles_dir + "/build.makefile_" + file_suff])
else:
qmake_bat = []
qmake_bat.append("call \"" + config.option("vs-path") + "/vcvarsall.bat\" " + ("x86" if base.platform_is_32(platform) else "x64"))