checkflist:

- add "-M metalog".  if metalog starts with "${DESTDIR}/", it
	  will be skipped in the flist check, to prevent unnecessary
	  warnings about extraneous ./METALOG
	- if the diff returned a non-zero exit code, print a warning message,
	  and for the default diff output, print a blurb describing the
	  meaning of the output.

Makefile:
	- call checkflist with "-M ${METALOG}" if UNPRIVED
	- run "${MAKE} checkflist" if ${DESTDIR} != ""

 NOTE:	this change will prevent maketars from running if the
	sets lists are out of date.  This is intentional.
	Better to fail than to build tar files with missing files.
This commit is contained in:
lukem 2002-07-09 16:08:38 +00:00
parent e6589dc35e
commit dc4928f26f
2 changed files with 43 additions and 9 deletions

View File

@ -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}

View File

@ -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 <<USAGE
Usage: $0 [-x11|-both] [-u|-c]
Usage: ${prog} [-x11|-both] [-u|-c] [-M metalog]
-x11 check only x11 lists
-both check netbsd + x11 lists
-u output differences in "unified diff" style
-c output differences in "context diff" style
-M metalog metalog file
USAGE
exit 1
;;
@ -49,8 +57,31 @@ USAGE
shift
done
if [ -n "$metalog" ]; then
case "$metalog" in
${DESTDIR}/*)
findargs="! -path ./${metalog#${DESTDIR}/} -a"
;;
esac
fi
sh makeflist $xargs $dargs > $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