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. # The `all' target must appear before bsd.own.mk is pulled in.
all: all:
@ -44,7 +44,7 @@ makeflist: .PHONY check_DESTDIR
.PRECIOUS: checkflist .PRECIOUS: checkflist
checkflist: check_DESTDIR checkflist: check_DESTDIR
${SETSENV} sh ${.CURDIR}/checkflist ${SETSENV} sh ${.CURDIR}/checkflist ${UNPRIVED:D-M ${METALOG}}
.PRECIOUS: checkflist-x11 .PRECIOUS: checkflist-x11
checkflist-x11: check_DESTDIR checkflist-x11: check_DESTDIR
@ -52,6 +52,9 @@ checkflist-x11: check_DESTDIR
.PRECIOUS: maketars .PRECIOUS: maketars
maketars: check_DESTDIR check_RELEASEDIR maketars: check_DESTDIR check_RELEASEDIR
.if (${DESTDIR} != "")
${MAKE} checkflist
.endif
${SETSENV} sh ${.CURDIR}/maketars ${UNPRIVED:D-M ${METALOG}} \ ${SETSENV} sh ${.CURDIR}/maketars ${UNPRIVED:D-M ${METALOG}} \
-d ${DESTDIR} -t ${RELEASEDIR}/binary/sets ${MAKETARSETS} -d ${DESTDIR} -t ${RELEASEDIR}/binary/sets ${MAKETARSETS}

View File

@ -1,13 +1,15 @@
#! /bin/sh -- #! /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. # Verify output of makeflist against contents of $DESTDIR.
[ "$DESTDIR" ] || { if [ -z "$DESTDIR" ]; then
echo DESTDIR must be set echo "DESTDIR must be set"
exit 1 exit 1
} fi
prog=${0##*/}
origin=. origin=.
tmpname=/tmp/_CHECK.$$ tmpname=/tmp/_CHECK.$$
@ -15,6 +17,8 @@ tmpname=/tmp/_CHECK.$$
xargs="" xargs=""
dargs="" dargs=""
diffargs="" diffargs=""
findargs=
metalog=
# handle args # handle args
while : ; do while : ; do
@ -32,13 +36,17 @@ while : ; do
-c) -c)
diffargs="-c" diffargs="-c"
;; ;;
-M*)
metalog=$2; shift
;;
-*) -*)
cat 1>&2 <<USAGE cat 1>&2 <<USAGE
Usage: $0 [-x11|-both] [-u|-c] Usage: ${prog} [-x11|-both] [-u|-c] [-M metalog]
-x11 check only x11 lists -x11 check only x11 lists
-both check netbsd + x11 lists -both check netbsd + x11 lists
-u output differences in "unified diff" style -u output differences in "unified diff" style
-c output differences in "context diff" style -c output differences in "context diff" style
-M metalog metalog file
USAGE USAGE
exit 1 exit 1
;; ;;
@ -49,8 +57,31 @@ USAGE
shift shift
done done
if [ -n "$metalog" ]; then
case "$metalog" in
${DESTDIR}/*)
findargs="! -path ./${metalog#${DESTDIR}/} -a"
;;
esac
fi
sh makeflist $xargs $dargs > $tmpname 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 /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