diff options
author | Will Andrews <will@FreeBSD.org> | 2000-05-24 05:29:54 +0000 |
---|---|---|
committer | Will Andrews <will@FreeBSD.org> | 2000-05-24 05:29:54 +0000 |
commit | 2247ec04c2979a6c249e4e7a481e680ef3e35e56 (patch) | |
tree | b5e245e25d0b1c632133cfdffe906dbc1425aa98 /Tools | |
parent | c970b381edbfc9ea49cf6ef4d65725d40d85cc01 (diff) | |
download | ports-2247ec04c2979a6c249e4e7a481e680ef3e35e56.tar.gz ports-2247ec04c2979a6c249e4e7a481e680ef3e35e56.zip |
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/scripts/checksum.sh | 98 |
1 files changed, 57 insertions, 41 deletions
diff --git a/Tools/scripts/checksum.sh b/Tools/scripts/checksum.sh index b227812f7d7c..a2a1b6c6b693 100755 --- a/Tools/scripts/checksum.sh +++ b/Tools/scripts/checksum.sh @@ -1,7 +1,11 @@ #!/bin/sh +# +# Created by: Alexander Langer <alex@big.endian.de> +# Created on: May 22, 2000 +# MAINTAINER= alex@big.endian.de if [ -z $1 ]; then - echo "Usage: $0 <portname>" + echo "Usage: $0 <portname> ..." exit 1 fi @@ -12,50 +16,62 @@ if [ -z $PORTSDIR ]; then PORTSDIR=/usr/ports fi -cd $PORTSDIR -DIR=`grep $1 INDEX| cut -f2 -d\|` -cd $DIR +while [ ! -z $1 ]; do + echo "Processing for $1..." -make fetch -broken=`make checksum 2>&1 | grep "Checksum mismatch for" | awk '{print $5}' \ - | sed -e 's:\.$::'` + cd $PORTSDIR + DIR=`grep $1 INDEX| cut -f2 -d\|` + cd $DIR -if [ -z $broken ]; then - make checksum - echo "Checksum ok, exiting..." - exit 1 -fi + make fetch + broken=`make checksum 2>&1 | grep "Checksum mismatch for" | \ + awk '{print $5}' | sed -e 's:\.$::'` -rm -rf $TMPDIR/checksum -mkdir $TMPDIR/checksum -cd $TMPDIR/checksum -mkdir $TMPDIR/checksum/orig -mkdir $TMPDIR/checksum/new + if [ -z $broken ]; then + make checksum + shift + continue + fi -echo Fetching $broken -fetch ftp://ftp.FreeBSD.ORG/pub/FreeBSD/distfiles/$broken + rm -rf $TMPDIR/checksum + mkdir $TMPDIR/checksum + cd $TMPDIR/checksum + mkdir $TMPDIR/checksum/orig + mkdir $TMPDIR/checksum/new -if [ ! -r $broken ]; then - echo "File $broken not found, fetch error?" - exit 1 -fi + echo Fetching $broken + fetch ftp://ftp.FreeBSD.ORG/pub/FreeBSD/distfiles/$broken -if file $broken | grep "gzip compressed data" >/dev/null; then - cd orig - tar -zxf ../$broken - cd ../new - tar -zxf $PORTSDIR/distfiles/$broken - cd .. -elif file $broken | grep "zip archive file" >/dev/null ; then - cd orig - unzip ../$broken - cd ../new - unzip $PORTSDIR/distfiles/$broken - cd .. -else - cp $broken orig/ - cp $PORTSDIR/distfiles/$broken new/ -fi + if [ ! -r $broken ]; then + echo "File $broken not found, fetch error?" + exit 1 + fi + + if file $broken | grep "gzip compressed data" >/dev/null; then + cd orig + tar -zxf ../$broken + cd ../new + tar -zxf $PORTSDIR/distfiles/$broken + cd .. + elif file $broken | grep "zip archive file" >/dev/null; then + cd orig + unzip ../$broken + cd ../new + unzip $PORTSDIR/distfiles/$broken + cd .. + elif file $broken | grep "bzip compressed data" >/dev/null; then + cd orig + tar -yxf ../$broken + cd ../new + tar -yxf $PORTSDIR/distfiles/$broken + cd .. + else + cp $broken orig/ + cp $PORTSDIR/distfiles/$broken new/ + fi + + echo Diff follows: + diff -rNu orig new -echo Diff follows: -diff -rNu orig new + shift +done |