Changeset 1529 in MondoRescue for branches/stable/mindi/mindi
- Timestamp:
- Jul 6, 2007, 2:28:03 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mindi/mindi
r1508 r1529 301 301 302 302 CopyDependenciesToDirectory() { 303 local outdir incoming fname filesize counter 303 local outdir incoming fname filesize counter d found 304 304 outdir=$1 305 305 mkdir -p $outdir … … 307 307 counter=0 308 308 while [ "$incoming" != "" ] ; do 309 if [ -d "$incoming" ] ; then 309 # Non absolute file names should not arrive till here => skipped 310 if [ `echo "$incoming" | cut -c1` != '/' ]; then 311 LogIt "Unable to handle $incoming" 312 incoming=`ReadLine` 313 continue 314 fi 315 # no parent directory of incoming should be a link, copy is not possible in that case 316 d=`dirname "$incoming"` 317 found="false" 318 while [ $d != "/" -a $found = "false" ]; do 319 [ -h "$d" ] && found="true" 320 d=`dirname "$d"` 321 done 322 if [ -d "$incoming" ] && [ ! -h "$incoming" ]; then 310 323 find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir 311 elif [ -e "$incoming" ] ; then324 elif [ -e "$incoming" ] && [ $found = "false" ]; then 312 325 filesize=`du -sk $incoming | cut -f1` 313 326 if [ "$filesize" -gt "$(($CHOPSIZE*2))" ] && [ ! -h "$incoming" ] ; then … … 994 1007 echo "$fname is softlink" >> $LOGFILE 995 1008 else 996 ldd $fname 2> /dev/null | ProcessLDD $fname1009 ldd $fname 2> /dev/null | ProcessLDD 997 1010 fi 998 1011 done … … 1025 1038 local i path fname_to_find location output resolved tmp stub cache_id loclist 1026 1039 fname_to_find="$1" 1040 # It's an absolute path 1027 1041 if echo "$fname_to_find" | grep -x "/.*" ; then 1028 1042 output="$fname_to_find" … … 1033 1047 return 0 1034 1048 fi 1049 # It's not an absolute path 1035 1050 output="" 1036 for path in /etc /usr /usr/bin /usr/sbin /bin /usr/X11R6/bin /sbin /usr/local/bin /usr/local/sbin /usr/lib /usr/lib64 /usr/lib64/* /lib /lib64 /lib64/* /usr/local/lib /usr/local/lib64 /usr/local/lib64/* /usr/X11R6/lib /usr/X11R6/lib64 /usr/X11R6/lib64/* ; do 1037 [ ! -d "$path" ] && continue 1038 for location in "$path/$fname_to_find" ; do 1039 [ ! -e "$location" ] && continue 1040 output="$location $output" 1041 if [ -h "$location" ] ; then 1042 output="`ReadAllLink $location` $output" 1043 fi 1044 done 1051 for path in /etc /usr /usr/bin /usr/sbin /bin /usr/X11R6/bin /sbin /usr/local/bin /usr/local/sbin `find /usr/lib /lib /usr/local/lib /usr/X11R6/lib /usr/lib64 /lib64 /usr/local/lib64 /usr/X11R6/lib64 -type d -maxdepth 1 2> /dev/null` ; do 1052 #for path in /etc /usr /usr/bin /usr/sbin /bin /usr/X11R6/bin /sbin /usr/local/bin /usr/local/sbin /usr/lib /usr/lib64 /usr/lib64/* /lib /lib64 /lib64/* /usr/local/lib /usr/local/lib64 /usr/local/lib64/* /usr/X11R6/lib /usr/X11R6/lib64 /usr/X11R6/lib64/* ; do 1053 [ -h "$path" ] && continue 1054 [ ! -e "$path/$fname_to_find" ] && continue 1055 output="$path/$fname_to_find $output" 1056 if [ -h "$path/$fname_to_find" ] ; then 1057 output="`ReadAllLink $path/$fname_to_find` $output" 1058 fi 1045 1059 done 1046 1060 if [ "$output" = "" ] ; then … … 2314 2328 2315 2329 ProcessLDD() { 2316 local main_fname incoming j i fname f newf 2317 main_fname=$1 2330 local incoming f 2318 2331 read incoming 2319 2332 while [ "$incoming" != "" ] ; do 2320 2333 # We take the full path name of the dyn. lib. we want 2321 incoming=`echo "$incoming" | sed '/[[:blank:]]*.*[[:blank:]]*=>[[:blank:]]*(.*/d ; s/[[:blank:]]*.*[[:blank:]]*=>[[:blank:]]*\(\/.*\)/\1/ ; s/[[:blank:]]*\(\/.*\)[[:blank:]]*(.*/\1/'`2322 for f in `echo "$incoming"`; do2334 incoming=`echo "$incoming" | awk '{if (match($1,/\//)) {print $1} else {if (match($3,/\//)) print $3} fi}'` 2335 for f in $incoming ; do 2323 2336 echo "$f `ReadAllLink $f`" 2324 2337 done
Note:
See TracChangeset
for help on using the changeset viewer.