From: Tony Crisci Date: Tue, 15 Oct 2013 07:36:12 +0000 (-0400) Subject: Testcases: remove "latest" if it is a symbolic link X-Git-Tag: 4.7~35 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cf3da1c43317f9a0eaea259f64e5823797c0525f;p=i3%2Fi3 Testcases: remove "latest" if it is a symbolic link Test for the existence of the symlink to "latest" with the -l flag, which tests if the target is a symbolic link. Testing with the -e flag will fail in case the link points to a file that does not exist, which will occur if the test result directories are deleted by hand. --- diff --git a/testcases/complete-run.pl b/testcases/complete-run.pl index c6e74369..7ca89016 100755 --- a/testcases/complete-run.pl +++ b/testcases/complete-run.pl @@ -108,7 +108,7 @@ $outdir .= POSIX::strftime("%Y-%m-%d-%H-%M-%S-", localtime()); $outdir .= `git describe --tags`; chomp($outdir); mkdir($outdir) or die "Could not create $outdir"; -unlink("latest") if -e "latest"; +unlink("latest") if -l "latest"; symlink("$outdir", "latest") or die "Could not symlink latest to $outdir";