#! /bin/sh -- # # $NetBSD: checkflist,v 1.19 2003/07/10 03:19:15 lukem Exp $ # # Verify output of makeflist against contents of $DESTDIR. if [ -z "$DESTDIR" ]; then echo "DESTDIR must be set" exit 1 fi prog=${0##*/} origin=. tmpname=/tmp/_CHECK.$$ xargs="" dargs="" diffargs="" metalog= # handle args while : ; do case $1 in -x11) xargs="-x" origin="./etc/X11 ./etc/fonts ./usr/X11R6" ;; -both) xargs="-b" ;; -u) diffargs="-u" ;; -c) diffargs="-c" ;; -M*) metalog=$2; shift ;; -*) cat 1>&2 < $tmpname ( cd $DESTDIR find $origin \( -type d -o -type f -o -type l \) ) | ( while read line; do case "$line" in $metalog) ;; *) echo $line ;; esac done ) | 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 is in flist but missing from DESTDIR" echo " (file wasn't installed ?)" echo " > file is in DESTDIR but missing from flist" echo " (file is obsolete or flist is out of date ?)" fi fi exit $rv