#!/bin/sh
# @(#) $Revision: 1.6 $
# @(#) RCS control in //prime.corp/usr/local/src/cmd/prime/src/chkcomp.sh
#
# chkcomp - check the setname.comp file
#
# The setname.comp file contains recent composite values found;
# lines of 4 values:
#
#	q, n, k, & +1/-1
#
# --or-- q checkpoint value.
#
# Copyright (C) 1997 Landon Curt Noll, all rights reserved.
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose is hereby granted, provided that
# the above copyright, this permission notice, and the disclaimer
# below appear in all of the following:
#
#         * supporting documentation
#         * source copies
#         * source works derived from this source
#
# THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
# EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
# USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
# OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
# Landon Curt Noll <chongo was here> /\oo/\
#
# chongo@{toad,sgi}.com		Share and Enjoy!

# parse args
#
if [ $# -ne 1 ]; then
    echo "usage: $0 setname" 1>&2
    exit 1
fi
dir=$1
setname="`basename $dir`"
if [ ! -d "$dir" ]; then
    echo "$0: $dir is not a directory" 1>&2
    exit 2
fi
if [ ! -f "$dir/$setname.comp" ]; then
    echo "$0: file $dir/$setname.comp not found" 1>&2
    exit 3
fi

# scan 4 arg lines
#
awk -f chkcomp.awk < "$dir/$setname.comp" | calc | egrep -v '"t" defined'
