summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-11-17 17:25:44 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-11-17 17:25:44 +0000
commit49ee6a7546c7e022bca22e631e86b5b24b9e8267 (patch)
tree27c86264fbc5327a1beda266477c4392444bc166
parent5157c27d1a4c2223e46999cd4405872b1d2e5807 (diff)
downloadperl-MDK-Common-49ee6a7546c7e022bca22e631e86b5b24b9e8267.tar
perl-MDK-Common-49ee6a7546c7e022bca22e631e86b5b24b9e8267.tar.gz
perl-MDK-Common-49ee6a7546c7e022bca22e631e86b5b24b9e8267.tar.bz2
perl-MDK-Common-49ee6a7546c7e022bca22e631e86b5b24b9e8267.tar.xz
perl-MDK-Common-49ee6a7546c7e022bca22e631e86b5b24b9e8267.zip
substInFile: if file is a symlink, make sure it stays a symlink
-rw-r--r--MDK/Common/File.pm9
-rw-r--r--perl-MDK-Common.spec5
2 files changed, 13 insertions, 1 deletions
diff --git a/MDK/Common/File.pm b/MDK/Common/File.pm
index 49895a0..95b2b30 100644
--- a/MDK/Common/File.pm
+++ b/MDK/Common/File.pm
@@ -219,6 +219,14 @@ 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) {
local @ARGV = $file;
local $^I = '';
@@ -235,6 +243,7 @@ sub substInFile(&@) {
select $old;
eval { output($file, $_) };
}
+ $linkdest and symlink $file, $linkdest;
}
diff --git a/perl-MDK-Common.spec b/perl-MDK-Common.spec
index 1c1cb8b..afa126f 100644
--- a/perl-MDK-Common.spec
+++ b/perl-MDK-Common.spec
@@ -2,7 +2,7 @@
# do not change the version here, change in MDK/Common.pm.pl
%define version THEVERSION
-%define release 2mdk
+%define release 3mdk
%ifarch x86_64
%define build_option PERL_CHECKER_TARGET='debug-code BCSUFFIX=""'
@@ -72,6 +72,9 @@ rm -rf $RPM_BUILD_ROOT
# MODIFY IN THE CVS: cvs.mandrakesoft.com:/cooker soft/perl-MDK-Common
%changelog
+* Mon Nov 17 2003 Guillaume Cottenceau <gc@mandrakesoft.com> 1.1.8-3mdk
+- substInFile: if file is a symlink, make sure it stays a symlink
+
* Mon Nov 10 2003 Thierry Vignaud <tvignaud@mandrakesoft.com> 1.1.8-2mdk
- fix path in po generated from sources