From: Ian Jackson Date: Mon, 14 Jul 2014 11:37:43 +0000 (+0100) Subject: building: Delete when cloning, not when preparing $builddir X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=19bb6265a24d218880863311322fb28b23125012;p=people%2Fdariof%2Fosstest.git building: Delete when cloning, not when preparing $builddir 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 --- v2: Provide motivation in the commit message. --- diff --git a/Osstest/BuildSupport.pm b/Osstest/BuildSupport.pm index 0938810..874e27e 100644 --- a/Osstest/BuildSupport.pm +++ b/Osstest/BuildSupport.pm @@ -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); } diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 22dcbff..3930595 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -1061,9 +1061,12 @@ sub build_clone ($$$$) { } } + my $rm = "rm -rf $subdir"; + if ($vcs eq 'hg') { target_cmd_build($ho, $timeout, $builddir, <