--- fetch_patches.sh 2009-02-15 06:06:53.000000000 +0100 +++ fetch_patches.sh 2009-02-15 20:07:14.196786279 +0100 @@ -12,13 +12,35 @@ # change IFS to loop line-by-line _OLDIFS=$IFS - IFS=" -" + IFS=$'\n' + echo -e "\tfetching checksumfile for patches" wget ${_rpath}/MD5SUMS >/dev/null 2>&1 downloads=0 - for _line in $(/bin/cat MD5SUMS); do + if grep -q '.gz$' MD5SUMS; then + for _line in $(grep '.gz$' MD5SUMS); do + _md5=$(echo $_line | cut -d ' ' -f1) + _file=$(echo $_line | cut -d ' ' -f3) + wget ${_rpath}/${_file} + + if [ $(echo "${_md5} ${_file}" | md5sum --status -c -) ]; then + echo ${_file} md5sums do not match + return 1 + fi + + gunzip ${_file} + downloads=$(echo ${_file} | sed "s/${_srcver}.[[:digit:]]\{3\}-\([[:digit:]]\{3\}\).gz/\1/") + done + fi + + # skip all lines included in a collection + for _line in $(tail +$(($downloads+1)) MD5SUMS); do + # skip lines with patch collections + if echo $_line | grep -q '.gz$'; then + continue + fi + downloads=$((${downloads} + 1)) _md5=$(echo $_line | cut -d ' ' -f1) _file=$(echo $_line | cut -d ' ' -f3)