diff --git a/release/Makefile b/release/Makefile index 14ba0c3c0bdf..f63c856504ac 100644 --- a/release/Makefile +++ b/release/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.46 1994/11/17 07:11:30 jkh Exp $ +# $Id: Makefile,v 1.47 1994/11/17 14:18:00 jkh Exp $ # # Evil floppies are, of course, 1.2MB floppies. @@ -131,7 +131,7 @@ release20: tar cf - . | \ ${ZIPNSPLIT} ${RELEASEDIR}/tarballs/bindist/bin_tgz.) cp ${.CURDIR}/extract.sh ${RELEASEDIR}/tarballs/bindist - ( cd ${RELEASEDIR}/tarballs/bindist; cksum * > CKSUMS ) + ( cd ${RELEASEDIR}/tarballs/bindist; ${.CURDIR}/mkchecksums.sh ) ( cd ${.CURDIR} ; \ ${MAKE} floppies ) foo: diff --git a/release/instdist.sh b/release/instdist.sh index b6a056dc8e9f..01bdd3f20d34 100644 --- a/release/instdist.sh +++ b/release/instdist.sh @@ -10,7 +10,7 @@ # putting your name on top after doing something trivial like reindenting # it, just to make it look like you wrote it!). # -# $Id: instdist.sh,v 1.2 1994/11/17 11:53:13 jkh Exp $ +# $Id: instdist.sh,v 1.3 1994/11/17 14:18:02 jkh Exp $ if [ "$_INSTINST_SH_LOADED_" = "yes" ]; then return 0 @@ -131,11 +131,20 @@ the files yourself.\n\n"; then return 1; fi media_extract_dist() { - if [ -f extract.sh ]; then - message "Extracting distribution.. Please wait!" - sh ./extract.sh < /dev/ttyv1 > /dev/ttyv1 2>&1 + if [ -f do_cksum.sh ]; then + message "Verifying checksums for distribution. Please wait!" + if sh ./do_cksum.sh; then + if [ -f extract.sh ]; then + message "Extracting distribution. Please wait!" + sh ./extract.sh < /dev/ttyv1 > /dev/ttyv1 2>&1 + else + error "No installation script found!" + fi + else + error "Checksum error(s) found. Please check media!" + fi else - error "Improper distribution. No installation script found!" + error "Improper distribution. No checksum script found!" fi } diff --git a/release/mkchecksums.sh b/release/mkchecksums.sh new file mode 100644 index 000000000000..bdfc8d851f9e --- /dev/null +++ b/release/mkchecksums.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# mkchecksums.sh - generate interactive checksum-checking script. +# Jordan Hubbard +# +# This script generates a cksum.sh script from a set of tarballs +# and should not be run by anyone but the release coordinator (there +# wouldn't be much point). +# +# Jordan +# $Id$ +# + +# First generate the CKSUMS file for the benefit of those who wish to +# use it in some other way. If we find out that folks aren't even using +# it, we should consider eliminating it at some point. The interactive +# stuff makes it somewhat superfluous. +cksum * > CKSUMS + +# Now generate a script for actually verifying the checksums. +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 +chmod +x do_cksum.sh