source: jhalfs-0.2-debian_31_as_host-1.patch@ 6e31ef7

0.2 1.0 2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since 6e31ef7 was 409488e, checked in by Manuel Canales Esparcia <manuel@…>, 19 years ago

Removed extra uneeded lines.

  • Property mode set to 100644
File size: 1.6 KB
  • jhalfs

    Submitted By: Jhon Kelly (jakelly at shtc dot net)
    Date: 2005-09-26
    Initial Package Version: 0.2
    Origin: alfs-discuss
    Upstream Status: Optional
    Description: Allow jhalfs to work with a md5sum program
    that don't accept - as filename, like the one shipped with
    Debian 3.1 stable.
    
    old new  
    189189  DIR=`echo $1 | sed 's@-doc@@'`
    190190
    191191  # Find the md5 sum for this package.
    192   if [ $2 != MD5SUMS ] ; then MD5=`grep "  $2" MD5SUMS` ; fi
     192  if [ $2 != MD5SUMS ] ; then
     193    MD5=$(grep " $2" MD5SUMS | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/ /g')
     194    md5_file=${MD5#* } ; md5_chksum=${MD5% *}
     195  fi
    193196
    194   if [ ! -f $2 ] ; then
     197  if [ ! -f $2 -o $2 == MD5SUMS ] ; then
    195198    case $DL in
    196199      wget )
    197200        wget $HTTP/$DIR/$2
     
    203206        echo "$DL not supported at this time."
    204207        ;;
    205208    esac
    206   elif ! echo "$MD5" | md5sum -c - >/dev/null 2>/dev/null ; then
     209  elif [ "$md5_chksum" != "$(md5sum $md5_file | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/\t/g' | cut -f 1)" ] ; then
    207210    case $DL in
    208211      wget )
    209212        wget -c $HTTP/$DIR/$2
     
    216219        ;;
    217220    esac
    218221  fi
    219   if [ $2 != MD5SUMS ] && ! echo "$MD5" | md5sum -c - ; then
    220     exit 1
     222  if [ $2 != MD5SUMS ] ; then
     223     if [ "$md5_chksum" != "$(md5sum $md5_file | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/\t/g' | cut -f 1)" ] ; then
     224       echo "$2 md5 checksum does not match $md5_chksum"
     225       exit 1
     226     fi
    221227  fi
    222228}
    223229
Note: See TracBrowser for help on using the repository browser.