From 8604aa6dd047244279e1783ddb2bcbeb7a104760 Mon Sep 17 00:00:00 2001 From: freesource Date: Thu, 15 Nov 2001 07:48:23 +0000 Subject: [PATCH] If Replacements are symlinks, the actual file linked to is copied, this helps with the new structure of allowing symlinks in Replacements. --- BootRoot/Yard.pm | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/BootRoot/Yard.pm b/BootRoot/Yard.pm index eaf77a5..1018361 100644 --- a/BootRoot/Yard.pm +++ b/BootRoot/Yard.pm @@ -1210,9 +1210,24 @@ sub copy_strip_file { } } else { # fallback just in case - # Normal copy, no strip - info(1, "Copying $from to $to\n"); - sys("cp -a $from $to"); + + # Normal copy, no strip + if ( $from !~ m,/Replacements/, ) { + info(1, "Copying $from to $to\n"); + sys("cp -a $from $to"); + } + else { + if ( !-l $from ) { + info(1, "Copying $from to $to\n"); + sys("cp -a $from $to"); + } + else { + $from = readlink($from); + info(1, "Copying $from to $to\n"); + sys("cp -a $from $to"); + } + } + } # Copy file perms and owner @@ -1240,9 +1255,24 @@ sub copy_strip_file { } else { + # Normal copy, no strip - info(1, "Copying $from to $to\n"); - sys("cp -a $from $to"); + if ( $from !~ m,/Replacements/, ) { + info(1, "Copying $from to $to\n"); + sys("cp -a $from $to"); + } + else { + if ( !-l $from ) { + info(1, "Copying $from to $to\n"); + sys("cp -a $from $to"); + } + else { + $from = readlink($from); + info(1, "Copying $from to $to\n"); + sys("cp -a $from $to"); + } + } + } }