diff --git a/distrib/sets/Makefile b/distrib/sets/Makefile index e40efa8b5160..8163a7b27de1 100644 --- a/distrib/sets/Makefile +++ b/distrib/sets/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.15 2002/05/02 18:02:51 lukem Exp $ +# $NetBSD: Makefile,v 1.16 2002/07/09 16:08:38 lukem Exp $ # The `all' target must appear before bsd.own.mk is pulled in. all: @@ -44,7 +44,7 @@ makeflist: .PHONY check_DESTDIR .PRECIOUS: checkflist checkflist: check_DESTDIR - ${SETSENV} sh ${.CURDIR}/checkflist + ${SETSENV} sh ${.CURDIR}/checkflist ${UNPRIVED:D-M ${METALOG}} .PRECIOUS: checkflist-x11 checkflist-x11: check_DESTDIR @@ -52,6 +52,9 @@ checkflist-x11: check_DESTDIR .PRECIOUS: maketars maketars: check_DESTDIR check_RELEASEDIR +.if (${DESTDIR} != "") + ${MAKE} checkflist +.endif ${SETSENV} sh ${.CURDIR}/maketars ${UNPRIVED:D-M ${METALOG}} \ -d ${DESTDIR} -t ${RELEASEDIR}/binary/sets ${MAKETARSETS} diff --git a/distrib/sets/checkflist b/distrib/sets/checkflist index aa333ad1e45f..94892d9f0f1d 100755 --- a/distrib/sets/checkflist +++ b/distrib/sets/checkflist @@ -1,13 +1,15 @@ #! /bin/sh -- # -# $NetBSD: checkflist,v 1.14 2000/11/18 05:29:21 wiz Exp $ +# $NetBSD: checkflist,v 1.15 2002/07/09 16:08:38 lukem Exp $ # # Verify output of makeflist against contents of $DESTDIR. -[ "$DESTDIR" ] || { - echo DESTDIR must be set +if [ -z "$DESTDIR" ]; then + echo "DESTDIR must be set" exit 1 -} +fi + +prog=${0##*/} origin=. tmpname=/tmp/_CHECK.$$ @@ -15,6 +17,8 @@ tmpname=/tmp/_CHECK.$$ xargs="" dargs="" diffargs="" +findargs= +metalog= # handle args while : ; do @@ -32,13 +36,17 @@ while : ; do -c) diffargs="-c" ;; + -M*) + metalog=$2; shift + ;; -*) cat 1>&2 < $tmpname -( cd $DESTDIR ; find $origin \( -type d -o -type f -o -type l \) ) | sort | \ - diff $diffargs $tmpname - +( + cd $DESTDIR + find $origin $findargs \( -type d -o -type f -o -type l \) +) | sort | diff $diffargs $tmpname - +rv=$? + /bin/rm -f $tmpname + +if [ $rv -ne 0 ]; then + echo "${prog}: flist inconsistencies found" + if [ -z "$diffargs" ]; then + echo "${prog}: key to output:" + echo " < file in flist but missing from DESTDIR" + echo " > file in DESTDIR but missing from flist" + fi +fi +exit $rv