Source-Changes-HG archive

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

[src/netbsd-1-6]: src/distrib/sets Pull up revision 1.15 (requested by lukem):



details:   https://anonhg.NetBSD.org/src/rev/2c3272dfc672
branches:  netbsd-1-6
changeset: 528383:2c3272dfc672
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue Jul 09 16:20:15 2002 +0000

description:
Pull up revision 1.15 (requested by lukem):
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/checkflist |  45 ++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 38 insertions(+), 7 deletions(-)

diffs (85 lines):

diff -r a8b4a894affe -r 2c3272dfc672 distrib/sets/checkflist
--- a/distrib/sets/checkflist   Tue Jul 09 16:20:07 2002 +0000
+++ b/distrib/sets/checkflist   Tue Jul 09 16:20:15 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.14.2.1 2002/07/09 16:20:15 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