#!/usr/bin/env osh : : osh - " Force sh(1), csh(1), and other shells to exit w/ error! " <'' ;;; : : " @(#)$Id: dosums 515 2008-10-20 17:59:44Z jneitzel $ " : : " The author of this file, J.A. Neitzel , " : " hereby grants it to the public domain. " : : : " Check the current list of working files against the SUMS file, " : " or make a new SUMS file from the current list of working files " : " according to the specified option. " : : " usage: dosums {-c | -m} " : : " Check for correct usage. " : >>$0'' <'' ; : >>$1'' <'' killer $0'' dosums if $n != 1 -o X$1 != X-c -a X$1 != X-m if { exit } pusage $0 '"{-c | -m}"' : " Do a `make clean' if needed. " ls dosums Makefile mkconfig *.[1ch]* | \ wc -w | tr -d ' \t' | grep '^24$' >/dev/null if $s != 0 make clean >/dev/null if X$1 != X-c goto $1 : fallthrough : -c - " Check the current list of working files against the SUMS file. " mksums dosums Makefile mkconfig *.[1ch]* | diff SUMS - ; exit : -m - " Make a new SUMS file from the current list of working files. " mksums dosums Makefile mkconfig *.[1ch]* >SUMS wc -l /dev/null if $s = 0 exit perror $0 '"SUMS file error - incorrect line count"'