Home | History | Annotate | Line # | Download | only in sets
checkflist revision 1.10.2.1
      1 #! /bin/sh --
      2 #
      3 #	$NetBSD: checkflist,v 1.10.2.1 2000/01/08 18:53:16 he Exp $
      4 #
      5 # Verify output of makeflist against contents of $DESTDIR.
      6 
      7 [ "$DESTDIR" ] || {
      8 	echo DESTDIR must be set
      9 	exit 1
     10 }
     11 
     12 origin=.
     13 tmpname=/tmp/_CHECK.$$
     14 
     15 xargs=""
     16 dargs=""
     17 diffargs=""
     18 
     19 # handle args
     20 while : ; do
     21 	case $1 in
     22 	-x11)
     23 		xargs="-x"
     24 		origin=./usr/X11R6
     25 		;;
     26 	-both)
     27 		xargs="-b"
     28 		;;
     29 	-secr)
     30 		dargs="-d"
     31 		;;
     32 	-u)
     33 		diffargs="-u"
     34 		;;
     35 	-c)
     36 		diffargs="-c"
     37 		;;
     38 	-*)
     39 		cat 1>&2 <<USAGE
     40 Usage: $0 [-x11|-both] [-secr]
     41 	-x11		check only x11 lists
     42 	-both		check netbsd + x11 lists
     43 	-secr		check domestic ("secr") lists
     44 	-u		output differences in "unified diff" style
     45 	-c		output differences in "context diff" style
     46 USAGE
     47 		exit 1
     48 		;;
     49 	*)
     50 		break
     51 		;;
     52 	esac
     53 	shift
     54 done
     55 
     56 sh makeflist $xargs $dargs > $tmpname
     57 
     58 ( cd $DESTDIR ; find $origin \( -type d -o -type f -o -type l \) ) | sort | \
     59     diff $diffargs $tmpname -
     60 /bin/rm -f $tmpname
     61