]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
buildman: Don't remove entire output directory when testing
authorSimon Glass <sjg@chromium.org>
Tue, 2 Dec 2014 00:33:56 +0000 (17:33 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 15 Jan 2015 05:16:52 +0000 (21:16 -0800)
When running tests the output directory is often wiped. This is only safe if
a branch is being built. The output directory may contain other things
besides the buildman test output.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/buildman/control.py

index 747c80d76a57d2c6f5f0e80ea5f9e242ae93430a..2249b0f70036cb4d0a7a1d0bb41bac92f446c882 100644 (file)
@@ -215,7 +215,8 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
         # output directory itself rather than any subdirectory.
         if not options.no_subdirs:
             output_dir = os.path.join(options.output_dir, dirname)
-    if clean_dir and os.path.exists(output_dir):
+    if (clean_dir and output_dir != options.output_dir and
+            os.path.exists(output_dir)):
         shutil.rmtree(output_dir)
     builder = Builder(toolchains, output_dir, options.git_dir,
             options.threads, options.jobs, gnu_make=gnu_make, checkout=True,