source: jhalfs-0.2-debian_31_as_host-1.patch@ 911fe33

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

Some minor tweaks to included patch. Might as well make it apply clean, too.

  • Property mode set to 100644
File size: 1.6 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  
    192192  DIR=`echo $1 | sed -e 's@-doc@@' -e 's@-linuxthreads@@' -e 's@-libidn@@'`
    193193
    194194  # Find the md5 sum for this package.
    195   if [ $2 != MD5SUMS ] ; then MD5=`grep "  $2" MD5SUMS` ; fi
     195  if [ $2 != MD5SUMS ] ; then
     196    MD5=$(grep " $2" MD5SUMS | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/ /g')
     197    md5_file=${MD5#* } ; md5_chksum=${MD5% *}
     198  fi
    196199
    197   if [ ! -f $2 ] ; then
     200  if [ ! -f $2 -o $2 == MD5SUMS ] ; then
    198201    case $DL in
    199202      wget )
    200203        wget $HTTP/$DIR/$2
     
    206209        echo "$DL not supported at this time."
    207210        ;;
    208211    esac
    209   elif ! echo "$MD5" | md5sum -c - >/dev/null 2>/dev/null ; then
     212  elif [ "$md5_chksum" != "$(md5sum $md5_file | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/\t/g' | cut -f 1)" ] ; then
    210213    case $DL in
    211214      wget )
    212215        wget -c $HTTP/$DIR/$2
     
    219222        ;;
    220223    esac
    221224  fi
    222   if [ $2 != MD5SUMS ] && ! echo "$MD5" | md5sum -c - ; then
    223     exit 1
     225  if [ $2 != MD5SUMS ] ; then
     226     if [ "$md5_chksum" != "$(md5sum $md5_file | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/\t/g' | cut -f 1)" ] ; then
     227       echo "$2 md5 checksum does not match $md5_chksum"
     228       exit 1
     229     fi
    224230  fi
    225231}
    226232
Note: See TracBrowser for help on using the repository browser.