#! /bin/sh # Copyright (C) 2007-2010 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . export LANG; LANG=C case $# in 0) exec make consistency-real;; esac srcdir=$1 bindir=$2 libdir=$srcdir/libidu m_flag="-m $libdir/id-lang.map" errors= cmd="$bindir/mkid $m_flag $srcdir" echo $cmd if eval $cmd; then files="`$bindir/fnid | grep -v single_file_token_bug`" if $bindir/xtokid $m_flag $files |sort -u >ID.xti && $bindir/lid |sed -e 's/[ ].*//' |sort -u >ID.lid && cmp -s ID.xti ID.lid then rm -f ID.xti ID.lid echo "Good. xtokid and lid agree." else mv ID.xti ID.bad-xti mv ID.lid ID.bad-lid 1>&2 echo "Oops! xtokid and lid disagree--look in ID.bad-{xti,lid}" errors=t fi xtokid_file=$$.xti fid_file=$$.fid for file in $files do if $bindir/fid $file >$fid_file && $bindir/xtokid $m_flag $file |sort -u >$xtokid_file && cmp -s $xtokid_file $fid_file; then echo "Good. xtokid and fid agree for $file" else 1>&2 echo "Oops! xtokid and fid disagree for $file--look in $file.bad-{xti,fid}" mv $xtokid_file $file.bad-xti mv $fid_file $file.bad-fid errors=t fi done rm -f $xtokid_file $fid_file else 1>&2 echo "Oops! mkid failed." errors=t fi cmd="$bindir/mkid $m_flag" echo $cmd if eval $cmd; then echo "Good. No crash when dealing with single file" else 1>&2 echo "Oops! mkid failed." errors=t fi case x$errors in xt) echo "Some checks failed." exit 1;; *) echo "All checks successful." exit 0;; esac