Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/sets checkflist:



details:   https://anonhg.NetBSD.org/src/rev/e3bf15b0945a
branches:  trunk
changeset: 533794:e3bf15b0945a
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue Jul 09 16:08:38 2002 +0000

description:
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.

diffstat:

 distrib/sets/Makefile   |   7 +++++--
 distrib/sets/checkflist |  45 ++++++++++++++++++++++++++++++++++++++-------
 2 files changed, 43 insertions(+), 9 deletions(-)

diffs (113 lines):

diff -r 29d532a6e33b -r e3bf15b0945a distrib/sets/Makefile
--- a/distrib/sets/Makefile     Tue Jul 09 15:07:19 2002 +0000
+++ b/distrib/sets/Makefile     Tue Jul 09 16:08:38 2002 +0000
@@ -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 @@
 
 .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 @@
 
 .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 -r 29d532a6e33b -r e3bf15b0945a distrib/sets/checkflist
--- a/distrib/sets/checkflist   Tue Jul 09 15:07:19 2002 +0000
+++ b/distrib/sets/checkflist   Tue Jul 09 16:08:38 2002 +0000
@@ -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 @@
 xargs=""
 dargs=""
 diffargs=""
+findargs=
+metalog=
 
 # handle args
 while : ; do
@@ -32,13 +36,17 @@
        -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 @@
        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



Home | Main Index | Thread Index | Old Index