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.
This commit is contained in:
Tony Crisci 2013-10-15 03:36:12 -04:00 committed by Michael Stapelberg
parent 4622fd8703
commit cf3da1c433
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ $outdir .= POSIX::strftime("%Y-%m-%d-%H-%M-%S-", localtime());
$outdir .= `git describe --tags`; $outdir .= `git describe --tags`;
chomp($outdir); chomp($outdir);
mkdir($outdir) or die "Could not create $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"; symlink("$outdir", "latest") or die "Could not symlink latest to $outdir";