Browse Source

autotest: copy the build_binaries.sh script before running

this prevents altering the script while running
mission-4.1.18
Andrew Tridgell 12 years ago
parent
commit
01b2ecbc55
  1. 8
      Tools/autotest/autotest.py

8
Tools/autotest/autotest.py

@ -80,7 +80,13 @@ def build_all(): @@ -80,7 +80,13 @@ def build_all():
def build_binaries():
'''run the build_binaries.sh script'''
print("Running build_binaries.sh")
if util.run_cmd(util.reltopdir('Tools/scripts/build_binaries.sh'), dir=util.reltopdir('.')) != 0:
import shutil
# copy the script as it changes git branch, which can change the script while running
orig=util.reltopdir('Tools/scripts/build_binaries.sh')
copy=util.reltopdir('./build_binaries.sh')
shutil.copyfile(orig, copy)
shutil.copymode(orig, copy)
if util.run_cmd(copy, dir=util.reltopdir('.')) != 0:
print("Failed build_binaries.sh")
return False
return True

Loading…
Cancel
Save