1.0
2.3
2.3.x
2.4
ablfs
ablfs-more
legacy
new_features
trunk
Last change
on this file since 5adc3fd 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
|
Rev | Line | |
---|
[bf3ad3a] | 1 | Submitted By: John Kelly (jakelly at shtc dot net)
|
---|
[4e5e9b4] | 2 | Date: 2005-09-26
|
---|
| 3 | Initial Package Version: 0.2
|
---|
| 4 | Origin: alfs-discuss
|
---|
| 5 | Upstream Status: Optional
|
---|
| 6 | Description: Allow jhalfs to work with a md5sum program
|
---|
[bf3ad3a] | 7 | that doesn't accept '-' as a filename, like the one shipped with
|
---|
[4e5e9b4] | 8 | Debian 3.1 stable.
|
---|
| 9 |
|
---|
[bf3ad3a] | 10 | --- jhalfs.orig 2005-11-01 07:10:00.104763416 -0500
|
---|
| 11 | +++ jhalfs 2005-11-01 07:10:02.472416413 -0500
|
---|
| 12 | @@ -192,9 +192,12 @@
|
---|
| 13 | DIR=`echo $1 | sed -e 's@-doc@@' -e 's@-linuxthreads@@' -e 's@-libidn@@'`
|
---|
| 14 |
|
---|
[4e5e9b4] | 15 | # Find the md5 sum for this package.
|
---|
| 16 | - if [ $2 != MD5SUMS ] ; then MD5=`grep " $2" MD5SUMS` ; fi
|
---|
| 17 | + if [ $2 != MD5SUMS ] ; then
|
---|
| 18 | + MD5=$(grep " $2" MD5SUMS | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/ /g')
|
---|
| 19 | + md5_file=${MD5#* } ; md5_chksum=${MD5% *}
|
---|
| 20 | + fi
|
---|
[bf3ad3a] | 21 |
|
---|
[4e5e9b4] | 22 | - if [ ! -f $2 ] ; then
|
---|
| 23 | + if [ ! -f $2 -o $2 == MD5SUMS ] ; then
|
---|
| 24 | case $DL in
|
---|
| 25 | wget )
|
---|
| 26 | wget $HTTP/$DIR/$2
|
---|
[bf3ad3a] | 27 | @@ -206,7 +209,7 @@
|
---|
[4e5e9b4] | 28 | echo "$DL not supported at this time."
|
---|
| 29 | ;;
|
---|
| 30 | esac
|
---|
| 31 | - elif ! echo "$MD5" | md5sum -c - >/dev/null 2>/dev/null ; then
|
---|
| 32 | + elif [ "$md5_chksum" != "$(md5sum $md5_file | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/\t/g' | cut -f 1)" ] ; then
|
---|
| 33 | case $DL in
|
---|
| 34 | wget )
|
---|
| 35 | wget -c $HTTP/$DIR/$2
|
---|
[bf3ad3a] | 36 | @@ -219,8 +222,11 @@
|
---|
[4e5e9b4] | 37 | ;;
|
---|
| 38 | esac
|
---|
| 39 | fi
|
---|
| 40 | - if [ $2 != MD5SUMS ] && ! echo "$MD5" | md5sum -c - ; then
|
---|
| 41 | - exit 1
|
---|
| 42 | + if [ $2 != MD5SUMS ] ; then
|
---|
| 43 | + if [ "$md5_chksum" != "$(md5sum $md5_file | sed -r -e 's/^[[:blank:]]+//;s/[[:blank:]]+$//;s/[[:blank:]]+/\t/g' | cut -f 1)" ] ; then
|
---|
| 44 | + echo "$2 md5 checksum does not match $md5_chksum"
|
---|
| 45 | + exit 1
|
---|
| 46 | + fi
|
---|
| 47 | fi
|
---|
| 48 | }
|
---|
[bf3ad3a] | 49 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.