From 01cb23d3d76f5f4d4643d96fcf00516cce12438f Mon Sep 17 00:00:00 2001 From: freesource Date: Fri, 24 Aug 2001 17:33:42 +0000 Subject: [PATCH] * This makes -> literal, before it was backwards. So /bin/sh -> bash works, before it had to be /bin/bash -> /bin/sh, so now the ls -l interpretation is correct. * Fixes unitialized values in onto_proc_filesystem. --- BootRoot/Yard.pm | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/BootRoot/Yard.pm b/BootRoot/Yard.pm index 02233a5..8c8c204 100644 --- a/BootRoot/Yard.pm +++ b/BootRoot/Yard.pm @@ -177,7 +177,13 @@ sub read_contents_file { cf_warn($line, "Can't use wildcards in link specification!"); next LINE; } - my($file, $link) = $line =~ /^(\S+)\s*->\s*(\S+)\s*$/; + + ## I decided to switch this from ($file,$link) to ($link,$file) + ## to make this more intuitive for users so something like + ## ls -l /bin/sh which ='s /bin/sh -> /bin/bash is literal + ## .. before it was backwards. + + my($link, $file) = $line =~ /^(\S+)\s*->\s*(\S+)\s*$/; if (!defined($link)) { cf_warn($line, "Can't parse this link"); next LINE; @@ -185,7 +191,10 @@ sub read_contents_file { ##### The '->' supersedes file structure on the disk, so don't ##### call include_file until pass two after all explicit links ##### have been seen. - my($abs_file) = find_file_in_path($file); + + ## find_file_in_path($file) changed to find_file_in_path($link) + + my($abs_file) = find_file_in_path($link); $Included{$abs_file} = 1 if $abs_file; #### Have to be careful here. Record the rel link for use #### in setting up the root fs, but use the abs_link in @files @@ -1650,7 +1659,14 @@ sub onto_proc_filesystem { my($file) = @_; my($sdev) = (stat($file))[0]; my($ldev) = (lstat($file))[0]; - $sdev == $proc_dev or $ldev == $proc_dev + + if ($sdev) { + $sdev = $proc_dev; + } + elsif ($ldev) { + $ldev = $proc_dev; + } + }