xref: /netbsd/distrib/sets/checkflist (revision bf9ec67e)
1#! /bin/sh --
2#
3#	$NetBSD: checkflist,v 1.14 2000/11/18 05:29:21 wiz 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
12origin=.
13tmpname=/tmp/_CHECK.$$
14
15xargs=""
16dargs=""
17diffargs=""
18
19# handle args
20while : ; do
21	case $1 in
22	-x11)
23		xargs="-x"
24		origin=./usr/X11R6
25		;;
26	-both)
27		xargs="-b"
28		;;
29	-u)
30		diffargs="-u"
31		;;
32	-c)
33		diffargs="-c"
34		;;
35	-*)
36		cat 1>&2 <<USAGE
37Usage: $0 [-x11|-both] [-u|-c]
38	-x11		check only x11 lists
39	-both		check netbsd + x11 lists
40	-u		output differences in "unified diff" style
41	-c		output differences in "context diff" style
42USAGE
43		exit 1
44		;;
45	*)
46		break
47		;;
48	esac
49	shift
50done
51
52sh makeflist $xargs $dargs > $tmpname
53
54( cd $DESTDIR ; find $origin \( -type d -o -type f -o -type l \) ) | sort | \
55    diff $diffargs $tmpname -
56/bin/rm -f $tmpname
57