]> xenbits.xensource.com Git - people/dariof/osstest.git/commitdiff
building: Delete when cloning, not when preparing $builddir
authorIan Jackson <ian.jackson@eu.citrix.com>
Mon, 14 Jul 2014 11:37:43 +0000 (12:37 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 16 Jul 2014 10:29:58 +0000 (11:29 +0100)
Make prepbuilddirs no longer delete $builddir; instead:
 - have prepbuilddirs delete *-stamp files and dist/;
 - have build_clone delete the specific source directories;
 - any individual ts-*-build scripts that use other things
   would have to delete them (but searching for $builddir
   reveals none).

This makes it possible for later steps within a build job to look at
the build trees from previous steps.  This is helpful if for any
reason it isn't easy or desirable to package up a formal set of build
outputs for reuse.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: Provide motivation in the commit message.

Osstest/BuildSupport.pm
Osstest/TestSupport.pm

index 0938810523199bbddf97f943586515e0963dd52e..874e27e39abd495dfe9bd0f5c4741f9b2ebe15b8 100644 (file)
@@ -74,7 +74,7 @@ sub builddirsprops {
 
 sub prepbuilddirs {
     my (@xbuilddirs) = @_;
-    my $cmd = "rm -rf $builddir && mkdir $builddir";
+    my $cmd = "mkdir -p $builddir && rm -rf $builddir/*-stamp $builddir/dist";
     $cmd .= " && mkdir $builddir/$_" foreach @xbuilddirs;
     target_cmd($ho,$cmd,600);
 }
index 22dcbff6798a72c28dda02edee151b7364a09b4c..3930595f909143927a29c7af1f9ec7f148fa2901 100644 (file)
@@ -1061,9 +1061,12 @@ sub build_clone ($$$$) {
        }
     }
 
+    my $rm = "rm -rf $subdir";
+
     if ($vcs eq 'hg') {
         
         target_cmd_build($ho, $timeout, $builddir, <<END.
+           $rm
            hg clone '$tree' $subdir
            cd $subdir
 END
@@ -1075,6 +1078,7 @@ END
        my $eff_tree = git_massage_url($tree);
 
         target_cmd_build($ho, $timeout, $builddir, <<END.
+            $rm
             git clone '$eff_tree' $subdir
             cd $subdir
 END