From c3d1b82e40ca16d1f43b4065849b73f47ede8506 Mon Sep 17 00:00:00 2001 From: freesource Date: Thu, 29 Nov 2001 19:35:31 +0000 Subject: [PATCH] If a replacement is found to be a file in an absolute location it is used. --- BootRoot/Yard.pm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/BootRoot/Yard.pm b/BootRoot/Yard.pm index cc302c4..c3fa397 100644 --- a/BootRoot/Yard.pm +++ b/BootRoot/Yard.pm @@ -394,8 +394,20 @@ sub read_contents_file { "left-hand side can't be directory"); # my($abs_replacement) = find_file_in_path($replacement,$main::global_yard); my($abs_replacement) = find_file_in_path($replacement); - if (!(defined($abs_replacement) and -e $abs_replacement)) { - cf_warn($contents_file, $line, "Can't find $replacement"); + + ## Absolute Replacements are all right --freesource + if ( !(defined($abs_replacement) and -e $abs_replacement) ) { + if ( !-f $replacement ) { + cf_warn($contents_file, $line, + "Can't find $replacement"); + } + else { + info(0, "Using Replacement $replacement because it was" . + "found in an absolute location\n"); + $abs_replacement = $replacement; + $replaced_by{$file} = $abs_replacement; + $Included{$file} = 1; + } } elsif ($replacement =~ m|^/dev/(?!null)|) { # Allow /dev/null but no other devices