source: jhalfs-0.2-debian_31_as_host-1.patch@ abe936d

1.0 2.3 2.3.x 2.4 ablfs ablfs-more legacy new_features trunk
Last change on this file since abe936d was 782efe8, checked in by Jeremy Huntwork <jhuntwork@…>, 19 years ago

Merged updated patch to trunk

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

    Submitted By: John 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 doesn't accept '-' as a filename, like the one shipped with
    Debian 3.1 stable.
    
    old new  
    260260  DIR=`echo $1 | sed 's@-doc@@;s@-linuxthreads@@;s@-libidn@@;s@-testsuite@@'`
    261261
    262262  # Find the md5 sum for this package.
    263   if [ $2 != MD5SUMS ] ; then MD5=`grep "  $2" MD5SUMS` ; fi
     263  if [ $2 != MD5SUMS ] ; then
     264    MD5=$(grep " $2" MD5SUMS | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/ /g')
     265    md5_file=${MD5#* } ; md5_chksum=${MD5% *}
     266  fi
    264267
    265   if [ ! -f $2 ] ; then
     268  if [ ! -f $2 -o $2 == MD5SUMS ] ; then
    266269    case $DL in
    267270      wget )
    268271        wget $HTTP/$DIR/$2
     
    274277        echo "$DL not supported at this time."
    275278        ;;
    276279    esac
    277   elif ! echo "$MD5" | md5sum -c - >/dev/null 2>/dev/null ; then
     280  elif [ "$md5_chksum" != "$(md5sum $md5_file | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/\t/g' | cut -f 1)" ] ; then
    278281    case $DL in
    279282      wget )
    280283        wget -c $HTTP/$DIR/$2
     
    287290        ;;
    288291    esac
    289292  fi
    290   if [ $2 != MD5SUMS ] && ! echo "$MD5" | md5sum -c - ; then
    291     exit 1
     293  if [ $2 != MD5SUMS ] ; then
     294     if [ "$md5_chksum" != "$(md5sum $md5_file | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/\t/g' | cut -f 1)" ] ; then
     295       echo "$2 md5 checksum does not match $md5_chksum"
     296       exit 1
     297     fi
    292298  fi
    293299  if [ $2 != MD5SUMS ] ; then
    294300    echo `grep "$MD5" MD5SUMS` >> MD5SUMS-$VERSION
Note: See TracBrowser for help on using the repository browser.