Changeset 3662 in MondoRescue for branches/3.3


Ignore:
Timestamp:
May 3, 2017, 11:27:13 AM (7 years ago)
Author:
Bruno Cornec
Message:

Remove useless code from CopyFromConf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi/mindi

    r3661 r3662  
    623623            filelist=`GenerateListForFile "$incoming"`
    624624            for tool in $filelist ; do
    625                 lvmresolved=`readlink -f $tool`
    626                 if [ "$tool" = "$lvmresolved" ]; then
    627                     echo "$tool" >> $tempfile
    628                 elif echo "$lvmresolved" | grep "lvmiopversion" &> /dev/null ; then
    629                     if [ "$lvmversion" = "" ] ; then
    630                         lvmversion=`$lvmresolved`
    631                         echo "$lvmresolved" >> $tempfile
    632                     fi
    633                     toolstripped=`echo $tool | $AWK -F / '{print $NF;}'`
    634                     if [ "$lvmversion" = "200" ]; then
    635                         # pvdata and lvmcreate_initrd don't exist in LVM2
    636                         case "$toolstripped" in
    637                         "pvdata")
     625            lvmresolved=`readlink -f $tool`
     626            if [ "$tool" = "$lvmresolved" ]; then
     627                echo "$tool" >> $tempfile
     628            elif echo "$lvmresolved" | grep "lvmiopversion" &> /dev/null ; then
     629                if [ "$lvmversion" = "" ] ; then
     630                    lvmversion=`$lvmresolved`
     631                    echo "$lvmresolved" >> $tempfile
     632                fi
     633                toolstripped=`echo $tool | $AWK -F / '{print $NF;}'`
     634                if [ "$lvmversion" = "200" ]; then
     635                    # pvdata and lvmcreate_initrd don't exist in LVM2
     636                    case "$toolstripped" in
     637                    "pvdata")
    638638                            continue
    639639                            ;;
    640                         "lvmcreate_initrd")
     640                    "lvmcreate_initrd")
    641641                            continue
    642642                            ;;
    643643                        esac
    644                     fi
    645                     toolpath="/sbin/lvm-"$lvmversion"/"$toolstripped
    646                     if [ -e "$toolpath" ] ; then
     644                fi
     645                toolpath="/sbin/lvm-"$lvmversion"/"$toolstripped
     646                if [ -e "$toolpath" ] ; then
    647647                        echo "$toolpath" >> $tempfile
    648648                        echo "$tool" >> $tempfile
    649                     else
     649                else
    650650                        toolpath="/lib/lvm-"$lvmversion"/"$toolstripped
    651                     fi
    652                     if [ -e "$toolpath" ] ; then
    653                         echo "$toolpath" >> $tempfile
    654                         echo "$tool" >> $tempfile
    655                     else
    656                         echo "Where are your LVM-Tools? Couldn't find $tool"
    657                     fi
     651                fi
     652                if [ -e "$toolpath" ] ; then
     653                    echo "$toolpath" >> $tempfile
     654                    echo "$tool" >> $tempfile
     655                else
     656                    echo "Where are your LVM-Tools? Couldn't find $tool"
     657                fi
    658658                else
    659659                    echo "$tool" >> $tempfile
     
    26442644    done
    26452645    echo -e "$DONE"
    2646     echo -en "INFO: Processing all dependencies links..."
    2647     # And their deps
    2648     lines=`sort -u $MINDI_TMP/$conf.lis $MINDI_TMP/$conf2.lis2`
    2649     noof_lines=`echo $lines | wc -w`
    2650     progress=0
    2651     for f in $lines; do
    2652         mr-read-all-link $f >> $MINDI_TMP/$conf.lis
    2653         if [ "`echo $f | cut -c1`" = "/" ]; then
    2654             j=`echo $f | cut -c2-`
    2655             [ "$j" != "" ] && rm -f $mountpoint/$j
    2656         fi
    2657         progress=$(($progress+1))
    2658         LogProgress $progress $noof_line
    2659     done
    2660     echo -e "$DONE"
     2646    echo "INFO: Processing all dependencies links for $conf.conf..."
     2647    # And their deps except dirs
     2648    lines=`sort -u $MINDI_TMP/$conf.lis $MINDI_TMP/$conf.lis2`
     2649    rm -f $MINDI_TMP/$conf.lis2
    26612650    finallist=""
    2662     # Remove directories from the list, as tar/cp will create them anyway
     2651    # Remove directories from the list, as cp will create them anyway
    26632652    # and it may hurt if /lib is in it as on Debian/Ubuntu
    26642653    # recent bash says that -d is true for a link to a dir !
    2665     for f in `sort -u $MINDI_TMP/$conf.lis`; do
     2654    for f in $lines; do
     2655    #for f in `sort -u $MINDI_TMP/$conf.lis`; do
    26662656        if [ -e "$f" -a ! -d "$f" ] || [ -h "$f" ]; then
    26672657            # Do not overwrite files already in destination (avoid using option -n of cp not portable)
     
    26752665    LogFile "INFO: Copying $conf related files with cp -a --parents $fnllist $lis3 -t $mountpoint/"
    26762666    cp -a --parents $fnllist $lis3 -t $mountpoint/ 2> $templog  || LogAll "WARNING: Problem in $conf analysis" $templog
    2677     rm -f $MINDI_TMP/$conf.lis $MINDI_TMP/$conf.lis2
     2667    rm -f $MINDI_TMP/$conf.lis
    26782668}
    26792669
Note: See TracChangeset for help on using the changeset viewer.