Don't overwrite current tar file while packing

Signed-off-by: fly <merspieler@airmail.cc>
This commit is contained in:
fly 2021-05-08 10:21:45 +02:00
parent a5d267a911
commit 1626816e2a

View file

@ -185,11 +185,11 @@ while running:
if os.listdir(tmp_dir + "/" + area):
run("mkdir -p " + output + "/" + part + "/" + area_major, shell=True)
cmd = "bash -c 'cd " + tmp_dir + " && tar -cJf " + output + "/" + part + "/" + area_major + "/" + area + ".txz " + area + "/'"
cmd = "bash -c 'cd " + tmp_dir + " && tar -cJf " + output + "/" + area + ".txz " + area + "/'"
with open(os.devnull, 'w') as fp:
package = Popen(cmd , shell=True, start_new_session=True, stdout=fp)
package.wait()
run("mv " + output + "/" + area + ".txz " + output + "/" + part + "/" + area_major + "/", shell=True)
update_index(output, part, area, area_major)
@ -205,6 +205,7 @@ while running:
running = False
try:
package.wait()
run("mv " + output + "/" + area + ".txz " + output + "/" + part + "/" + area_major + "/")
update_index(output, area, name_major)
api_send_status(name, "packaged", api, api_token)
except KeyboardInterrupt: