This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
MahiroOS-jhalfs/jhalfs-0.2-debian_31_as_host-1.patch

50 lines
1.7 KiB
Diff
Raw Normal View History

Submitted By: John Kelly (jakelly at shtc dot net)
2005-09-26 20:07:56 +02:00
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
2005-09-26 20:07:56 +02:00
Debian 3.1 stable.
2005-12-01 02:07:27 +01:00
--- jhalfs.orig 2005-12-01 00:57:13.000000000 +0000
+++ jhalfs 2005-12-01 00:57:26.000000000 +0000
@@ -260,9 +260,12 @@
DIR=`echo $1 | sed 's@-doc@@;s@-linuxthreads@@;s@-libidn@@;s@-testsuite@@'`
2005-09-26 20:07:56 +02:00
# Find the md5 sum for this package.
- if [ $2 != MD5SUMS ] ; then MD5=`grep " $2" MD5SUMS` ; fi
+ if [ $2 != MD5SUMS ] ; then
+ MD5=$(grep " $2" MD5SUMS | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/ /g')
+ md5_file=${MD5#* } ; md5_chksum=${MD5% *}
+ fi
2005-09-26 20:07:56 +02:00
- if [ ! -f $2 ] ; then
+ if [ ! -f $2 -o $2 == MD5SUMS ] ; then
case $DL in
wget )
wget $FTP/$DIR/$2
2005-12-01 02:07:27 +01:00
@@ -274,7 +277,7 @@
2005-09-26 20:07:56 +02:00
echo "$DL not supported at this time."
;;
esac
- elif ! echo "$MD5" | md5sum -c - >/dev/null 2>/dev/null ; then
+ elif [ "$md5_chksum" != "$(md5sum $md5_file | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/\t/g' | cut -f 1)" ] ; then
case $DL in
wget )
wget -c $FTP/$DIR/$2
2005-12-01 02:07:27 +01:00
@@ -287,8 +290,11 @@
2005-09-26 20:07:56 +02:00
;;
esac
fi
- if [ $2 != MD5SUMS ] && ! echo "$MD5" | md5sum -c - ; then
- exit 1
+ if [ $2 != MD5SUMS ] ; then
+ if [ "$md5_chksum" != "$(md5sum $md5_file | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/\t/g' | cut -f 1)" ] ; then
+ echo "$2 md5 checksum does not match $md5_chksum"
+ exit 1
+ fi
fi
2005-12-01 02:07:27 +01:00
if [ $2 != MD5SUMS ] ; then
echo `grep "$MD5" MD5SUMS` >> MD5SUMS-$VERSION