From 01b2ecbc556ee0a131d8004b8302f226723d88ab Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 23 Mar 2013 14:54:53 +1100 Subject: [PATCH] autotest: copy the build_binaries.sh script before running this prevents altering the script while running --- Tools/autotest/autotest.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tools/autotest/autotest.py b/Tools/autotest/autotest.py index d46bf64779..730fc40768 100755 --- a/Tools/autotest/autotest.py +++ b/Tools/autotest/autotest.py @@ -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