From b0f21e25fac7bfc359c0c284805ef2723d7dcc72 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Thu, 12 Dec 2013 11:46:26 -0800 Subject: [PATCH] Remove TMP/src.commit too, when removing TMP/src. --- sdk/cli/bin/crunch-job | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/cli/bin/crunch-job b/sdk/cli/bin/crunch-job index c04f29edd4..44cfee57c4 100755 --- a/sdk/cli/bin/crunch-job +++ b/sdk/cli/bin/crunch-job @@ -341,13 +341,13 @@ else Log (undef, "Install revision ".$Job->{script_version}); my $nodelist = join(",", @node); - # Clean out crunch_tmp/work, crunch_tmp/opt, crunch_tmp/src + # Clean out crunch_tmp/work, crunch_tmp/opt, crunch_tmp/src* my $cleanpid = fork(); if ($cleanpid == 0) { srun (["srun", "--nodelist=$nodelist", "-D", $ENV{'TMPDIR'}], - ['bash', '-c', 'if mount | grep -q $JOB_WORK/; then sudo /bin/umount $JOB_WORK/* 2>/dev/null; fi; sleep 1; rm -rf $JOB_WORK $CRUNCH_TMP/opt $CRUNCH_TMP/src']); + ['bash', '-c', 'if mount | grep -q $JOB_WORK/; then sudo /bin/umount $JOB_WORK/* 2>/dev/null; fi; sleep 1; rm -rf $JOB_WORK $CRUNCH_TMP/opt $CRUNCH_TMP/src*']); exit (1); } while (1) @@ -1351,7 +1351,7 @@ my $repo = $ENV{"CRUNCH_SRC_URL"}; open L, ">", "$destdir.lock" or die "$destdir.lock: $!"; flock L, LOCK_EX; -if (readlink ("$destdir.commit") eq $commit) { +if (readlink ("$destdir.commit") eq $commit && -d $destdir) { exit 0; } -- 2.30.2