Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/distrib/sets Pull up version 1.2 (requested by toddpw), ...



details:   https://anonhg.NetBSD.org/src/rev/49b26eeaefff
branches:  netbsd-1-5
changeset: 489143:49b26eeaefff
user:      toddpw <toddpw%NetBSD.org@localhost>
date:      Sun Aug 20 22:29:06 2000 +0000

description:
Pull up version 1.2 (requested by toddpw), for use in building release snaps.

diffstat:

 distrib/sets/makesums |  48 ++++++++++++++++++++++++++++++++++--------------
 1 files changed, 34 insertions(+), 14 deletions(-)

diffs (85 lines):

diff -r b989e6fb58e9 -r 49b26eeaefff distrib/sets/makesums
--- a/distrib/sets/makesums     Sat Aug 19 22:15:07 2000 +0000
+++ b/distrib/sets/makesums     Sun Aug 20 22:29:06 2000 +0000
@@ -1,26 +1,43 @@
 #!/bin/sh
 #
-# $NetBSD: makesums,v 1.1 1999/07/22 20:10:17 is Exp $
+# $NetBSD: makesums,v 1.1.8.1 2000/08/20 22:29:06 toddpw Exp $
+#
+# Make checksum files for files in ``tardir''.  Usage:
+# makesums [-t tardir] [ -all ] [setname ...]
 #
-# Make checksum files.  Usage:
-# makesums [-t tardir] [setname ...]
+# If -t is omitted, RELEASEDIR must be set and not empty.
+# The ``setname'' arguments comprise a list of files to checksum,
+# and may be omitted (in which case ``*.tgz'' is used).
+# If -all is given, then the list of sets is ignored, and ``*'' is used.
+#
+# After shell glob expansion, the list of sets is filtered to remove known
+# output file names (of the form *SUM and MD5), non-existent files, and
+# subdirectories. If this filtering leaves no files, then no output files are
+# produced. Otherwise the resulting list of files are checksummed and four
+# output files (BSDSUM, CKSUM, MD5, SYSVSUM) are produced.
 #
 
 # set defaults
-: ${MAKE=make}
+: ${MAKE=make} # XXX: what purpose does this serve??
 tars=$RELEASEDIR
+dash_all=no
 
 # handle args
 while : ; do
        case $1 in
+       -all)
+               dash_all=yes
+               break
+               ;;
        -t*)    
                tars=$2; shift
                ;;
        -*)
                cat 1>&2 <<USAGE
-Usage: $0 [-t tars] [setname ...]
+Usage: $0 [-t tars] [-all] [setname ...]
        -t tars         \$RELEASEDIR            [$tars]
        [setname ...]   sets to checksum        [*.tgz]
+       -all            do all plain files instead of [setname ...]
 USAGE
                exit 1
                ;;
@@ -30,9 +47,6 @@
        esac
        shift
 done
-if [ -n "$*" ]; then
-       lists="$*"
-fi
 
 if [ -z "$tars" ]; then
        echo \$RELEASEDIR must be set
@@ -40,10 +54,16 @@
 fi
 
 cd $tars
-if [ -z "$lists" ]; then
-       lists=*.tgz
+pat="$*"
+if [ $dash_all = yes ]; then
+       pat='*'
+elif [ -z "$pat" ]; then
+       pat='*.tgz'
 fi
-cksum -o1 $lists > BSDSUM
-cksum     $lists > CKSUM
-cksum -m  $lists > MD5
-cksum -o2 $lists > SYSVSUM
+lists=`find $pat -prune -type f \! -name '*SUM' \! -name MD5 2>/dev/null`
+if [ -n "$lists" ]; then
+       cksum -o1 $lists > BSDSUM
+       cksum     $lists > CKSUM
+       cksum -m  $lists > MD5
+       cksum -o2 $lists > SYSVSUM
+fi



Home | Main Index | Thread Index | Old Index