Changeset 1526 in MondoRescue for branches/2.2.4/mindi/mindi


Ignore:
Timestamp:
Jul 6, 2007, 12:55:59 PM (17 years ago)
Author:
Bruno Cornec
Message:
  • Fix a problem in directory link handling in mindi (seen on gentoo 64) with the precious help of Francesco Talamona ti.liame_at_email.it
  • Gentoo ebuild are now unmasked on my side
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.4/mindi/mindi

    r1519 r1526  
    297297
    298298CopyDependenciesToDirectory() {
    299     local outdir incoming fname filesize counter
     299    local outdir incoming fname filesize counter d found
    300300    outdir=$1
    301301    mkdir -p $outdir
     
    303303    counter=0
    304304    while [ "$incoming" != "" ] ; do
    305         if [ -d "$incoming" ] ; then
     305        # Non absolute file names should not arrive till here => skipped
     306        if [ `echo "$incoming" | cut -c1` != '/' ]; then
     307            LogIt "Unable to handle $incoming"
     308            incoming=`ReadLine`
     309            continue
     310        fi
     311        # no parent directory of incoming should be a link, copy is not possible in that case
     312        d=`dirname "$incoming"`
     313        found="false"
     314        while [ $d != "/" -a $found = "false" ]; do
     315            [ -h "$d" ] && found="true"
     316            d=`dirname "$d"`
     317        done
     318        if [ -d "$incoming" ] && [ ! -h "$incoming" ]; then
    306319            find $incoming/* -maxdepth 0 2> /dev/null | CopyDependenciesToDirectory $outdir
    307         elif [ -e "$incoming" ] ; then
     320        elif [ -e "$incoming" ] && [ $found = "false" ]; then
    308321            filesize=`du -sk $incoming | cut -f1`
    309322            if [ "$filesize" -gt "$(($CHOPSIZE*2))" ] && [ ! -h "$incoming" ] ; then
     
    9921005            echo "$fname is softlink" >> $LOGFILE
    9931006        else
    994             ldd $fname 2> /dev/null | ProcessLDD $fname
     1007            ldd $fname 2> /dev/null | ProcessLDD
    9951008        fi
    9961009    done
     
    10231036    local i path fname_to_find location output resolved tmp stub cache_id loclist
    10241037    fname_to_find="$1"
     1038    # It's an absolute path
    10251039    if echo "$fname_to_find" | grep -x "/.*" ; then
    10261040        output="$fname_to_find"
     
    10311045        return 0
    10321046    fi
     1047    # It's not an absolute path
    10331048    output=""
    1034     #for path in /etc /usr /usr/bin /usr/sbin /bin /usr/X11R6/bin /sbin /usr/local/bin /usr/local/sbin /usr/lib /usr/lib64 /lib /lib64 /usr/local/lib /usr/local/lib64 /usr/X11R6/lib /usr/X11R6/lib64 `find /usr/lib64 /lib64 /usr/local/lib64 /usr/X11R6/lib64 -type d` ; do
    1035     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
    1036         [ ! -d "$path" ] && continue
    1037         for location in "$path/$fname_to_find" ; do
    1038             [ ! -e "$location" ] && continue
    1039             output="$location $output"
    1040             if [ -h "$location" ] ; then
    1041                 output="`ReadAllLink $location` $output"
    1042             fi
    1043         done
     1049    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
     1050    #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
     1051        [ -h "$path" ] && continue
     1052        [ ! -e "$path/$fname_to_find" ] && continue
     1053        output="$path/$fname_to_find $output"
     1054        if [ -h "$path/$fname_to_find" ] ; then
     1055            output="`ReadAllLink $path/$fname_to_find` $output"
     1056        fi
    10441057    done
    10451058    if [ "$output" = "" ] ; then
     
    22182231
    22192232ProcessLDD() {
    2220     local main_fname incoming j i fname f newf
    2221     main_fname=$1
     2233    local incoming f
    22222234    read incoming
    22232235    while [ "$incoming" != "" ] ; do
    22242236        # We take the full path name of the dyn. lib. we want
    2225         incoming=`echo "$incoming" | sed '/[[:blank:]]*.*[[:blank:]]*=>[[:blank:]]*(.*/d ; s/[[:blank:]]*.*[[:blank:]]*=>[[:blank:]]*\(\/.*\)/\1/ ; s/[[:blank:]]*\(\/.*\)[[:blank:]]*(.*/\1/'`
    2226         for f in `echo "$incoming"` ; do
     2237        incoming=`echo "$incoming" | awk '{if (match($1,/\//)) {print $1} else {if (match($3,/\//)) print $3} fi}'`
     2238        for f in $incoming ; do
    22272239            echo "$f `ReadAllLink $f`"
    22282240        done
Note: See TracChangeset for help on using the changeset viewer.