openbsd-ports/infrastructure/fetch/check-distfiles
2002-11-27 16:56:00 +00:00

37 lines
803 B
Bash
Executable File

#!/bin/sh
#$OpenBSD: check-distfiles,v 1.3 2002/11/27 16:56:00 margarida Exp $
PATH=/bin:/usr/bin
export PATH
# This script does a full-scale check of everything that lives under
# /usr/ports/distfiles
PORTS=/usr/ports
ALLSUMS=`mktemp /tmp/checksums.XXXXXX` || exit 1
GREP_RESULT=`mktemp /tmp/grep.XXXXXX` || exit 1
# assume that INDEX is up-to-date
touch $ALLSUMS
cut -d\| -f2 <$PORTS/INDEX|while read i
do
if [ -f $i/distinfo ]
then
cat $i/distinfo >>$ALLSUMS
else
echo "Port $i does not seem to have a checksum file"
fi
done
cd $PORTS/distfiles
find . -type f|sed -e 's|^\./||'|while read name
do
if grep "^SHA1 ($name) = " $ALLSUMS >$GREP_RESULT
then
sha1 $name >>$GREP_RESULT
uniq -u <$GREP_RESULT
else
echo "no checksum recorded for $name"
fi
done
rm $ALLSUMS $GREP_RESULT