]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - release/mkchecksums.sh
Yow! Ok, distributions should now be fully auto-checksumming, provided
[FreeBSD/FreeBSD.git] / release / mkchecksums.sh
1 #!/bin/sh
2 #
3 # mkchecksums.sh - generate interactive checksum-checking script.
4 # Jordan Hubbard
5 #
6 # This script generates a cksum.sh script from a set of tarballs
7 # and should not be run by anyone but the release coordinator (there
8 # wouldn't be much point).
9 #
10 #                                       Jordan
11 # $Id$
12 #
13
14 # First generate the CKSUMS file for the benefit of those who wish to
15 # use it in some other way.  If we find out that folks aren't even using
16 # it, we should consider eliminating it at some point.  The interactive
17 # stuff makes it somewhat superfluous.
18 cksum * > CKSUMS
19
20 # Now generate a script for actually verifying the checksums.
21 awk 'BEGIN {print "rval=0"} { printf("if [ \"\`cksum %s%s%s\`\" != \"%s %s %s\" ]; then dialog --title Error --infobox \"Checksum error detected on %s!\" -1 -1; rval=1; fi\n", "\047", $3, "\047", $1, $2, $3, $3);} END {print "exit $rval"}' < CKSUMS > do_cksum.sh
22 chmod +x do_cksum.sh