checkflist revision 1.18
11.3Smikel#! /bin/sh -- 21.3Smikel# 31.18Stron# $NetBSD: checkflist,v 1.18 2003/03/01 07:31:35 tron Exp $ 41.3Smikel# 51.3Smikel# Verify output of makeflist against contents of $DESTDIR. 61.1Scgd 71.15Slukemif [ -z "$DESTDIR" ]; then 81.15Slukem echo "DESTDIR must be set" 91.1Scgd exit 1 101.15Slukemfi 111.15Slukem 121.15Slukemprog=${0##*/} 131.1Scgd 141.9Srossorigin=. 151.9Srosstmpname=/tmp/_CHECK.$$ 161.10Sperry 171.10Sperryxargs="" 181.10Sperrydargs="" 191.12Sabsdiffargs="" 201.15Slukemmetalog= 211.10Sperry 221.10Sperry# handle args 231.10Sperrywhile : ; do 241.10Sperry case $1 in 251.10Sperry -x11) 261.10Sperry xargs="-x" 271.18Stron origin="./etc/X11 ./etc/fonts ./usr/X11R6" 281.10Sperry ;; 291.10Sperry -both) 301.10Sperry xargs="-b" 311.10Sperry ;; 321.12Sabs -u) 331.12Sabs diffargs="-u" 341.12Sabs ;; 351.12Sabs -c) 361.12Sabs diffargs="-c" 371.12Sabs ;; 381.15Slukem -M*) 391.15Slukem metalog=$2; shift 401.15Slukem ;; 411.10Sperry -*) 421.10Sperry cat 1>&2 <<USAGE 431.15SlukemUsage: ${prog} [-x11|-both] [-u|-c] [-M metalog] 441.10Sperry -x11 check only x11 lists 451.10Sperry -both check netbsd + x11 lists 461.12Sabs -u output differences in "unified diff" style 471.12Sabs -c output differences in "context diff" style 481.15Slukem -M metalog metalog file 491.10SperryUSAGE 501.10Sperry exit 1 511.10Sperry ;; 521.10Sperry *) 531.10Sperry break 541.10Sperry ;; 551.10Sperry esac 561.10Sperry shift 571.10Sperrydone 581.10Sperry 591.15Slukemif [ -n "$metalog" ]; then 601.15Slukem case "$metalog" in 611.15Slukem ${DESTDIR}/*) 621.17Sthorpej # Metalog would be noticed, so make sure it gets 631.17Sthorpej # ignored. 641.17Sthorpej metalog="./${metalog#${DESTDIR}/}" 651.15Slukem ;; 661.17Sthorpej *) 671.17Sthorpej metalog="" 681.15Slukem esac 691.15Slukemfi 701.15Slukem 711.15Slukem 721.10Sperrysh makeflist $xargs $dargs > $tmpname 731.10Sperry 741.15Slukem( 751.15Slukem cd $DESTDIR 761.17Sthorpej find $origin \( -type d -o -type f -o -type l \) 771.17Sthorpej) | ( 781.17Sthorpej while read line; do 791.17Sthorpej test "$metalog" = "$line" || echo $line 801.17Sthorpej done 811.15Slukem) | sort | diff $diffargs $tmpname - 821.15Slukemrv=$? 831.15Slukem 841.9Sross/bin/rm -f $tmpname 851.15Slukem 861.15Slukemif [ $rv -ne 0 ]; then 871.15Slukem echo "${prog}: flist inconsistencies found" 881.15Slukem if [ -z "$diffargs" ]; then 891.15Slukem echo "${prog}: key to output:" 901.16Slukem echo " < file is in flist but missing from DESTDIR" 911.16Slukem echo " (file wasn't installed ?)" 921.16Slukem echo " > file is in DESTDIR but missing from flist" 931.16Slukem echo " (file is obsolete or flist is out of date ?)" 941.15Slukem fi 951.15Slukemfi 961.15Slukemexit $rv 97