Changeset 3262 in MondoRescue for branches/3.2/MondoRescue/lib/MondoRescue
- Timestamp:
- Apr 20, 2014, 11:24:46 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/MondoRescue/lib/MondoRescue/File.pm
r3229 r3262 89 89 This function returns all the links found for a given file passed as parameter 90 90 Example: mr_file_read_all_link(/lib64) returns (/lib64,/usr/lib64) on a system having a link from /lib64 to /usr/lib64 91 The return value is a hash of all input files pointing to arraysof links91 The return value is a hash of all input files pointing to hash of links 92 92 93 93 =cut … … 96 96 97 97 # TODO: Can be parallelized 98 my$files;98 our $files; 99 99 100 100 foreach my $f (@_) { … … 114 114 $link = mr_file_normalize($link,"$curdir/$dir"); 115 115 # It's a real symlink so handle it 116 push @{$files->{$f}},"$curdir/$dir";116 $files->{$f}->{"$curdir/$dir"} = 1; 117 117 if (substr($link,0,1) eq "/") { 118 118 $curdir = $link; … … 124 124 if ((-e $curdir) && ((! -d $curdir) || (-l $curdir))) { 125 125 my $h = mr_file_read_all_link($curdir); 126 pb_log(2," File: $curdir - Return:\n".Dumper($h)."\n");126 pb_log(2,"After Return h:\n".Dumper($h)."\n"); 127 127 foreach my $k (keys %$h) { 128 # At that point there is only one key129 # as there was one param passed to the function.130 128 foreach my $l (keys %$k) { 131 push @{$files->{$f}},$k->{$l}; 129 # Use $f as key as we affects all the files 130 # found in recursion to the current managed file 131 $files->{$f}->{$l} = 1; 132 132 } 133 133 } 134 pb_log(2,"After Return files:\n".Dumper($files)."\n"); 134 135 } 135 136 } else { … … 138 139 } 139 140 pb_log(2,"curdir is now: $curdir**\n"); 140 push @{$files->{$f}},$curdir if (-e $curdir); 141 } 141 $files->{$f}->{$curdir} = 1 if (-e $curdir); 142 } 143 pb_log(1,"mr_file_read_all_link returns:\n".Dumper($files)."\n"); 142 144 return($files); 143 145 }
Note:
See TracChangeset
for help on using the changeset viewer.