From 3019f58e316b2109e92fe7b7e2a06b3a2d1fc53c Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Wed, 7 Oct 2009 16:50:36 +0000 Subject: substInFile: do not unlink the symlink to recreate it later to the same target --- NEWS | 3 +++ lib/MDK/Common/File.pm | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index e75db2c..9bcefe6 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +- substInFile: + o do not unlink the symlink to recreate it later to the same target + Version 1.2.21 - 7 October 2009, by Thierry Vignaud - substInFile: diff --git a/lib/MDK/Common/File.pm b/lib/MDK/Common/File.pm index cdcfcd9..c06294c 100644 --- a/lib/MDK/Common/File.pm +++ b/lib/MDK/Common/File.pm @@ -272,12 +272,9 @@ sub glob_ { sub substInFile(&@) { my ($f, $file) = @_; - my $linkdest; #- try hard to keep symlinks as they were set if (-l $file) { my $targetfile = readlink $file; - unlink $file; - $linkdest = $file; $file = $targetfile; } if (-s $file) { @@ -299,7 +296,6 @@ sub substInFile(&@) { select $old; eval { output($file, $_) }; } - $linkdest and symlink $file, $linkdest; } -- cgit v1.2.1