#! /bin/sh # # auditver # # Shell script to 'audit' a software package version within the # the BaBar code system # # Bob Jacobsen Sept 1994 # # Checks done: (items with * are not yet implemented) # # The version is identical to the contents of the CVS repository (*) # All files are read-only (prod versions only) (*) # # Options: # -v Tells you the version, then quits. # -p This is a production version # -t This is a test version # # If neither -p or -t is specified, the script tries to guess # based on where the directory is. (*) If the current directory is # inconsistent with a given -p or -t option, a warning message # is printed, but execution continues. # # ################################################################ # define some symbols exitStatus=0 ################################################################ # process options test=0 prod=0 #amj:FNAL: getopts has replaced getopt as recommended usage on SGI and # DECUnix. Only getopts exists in the cygnus NT system. while getopts tpv c do case $c in p) prod=1; test=0;; t) prod=0; test=1;; v) echo "Debug version";exit 0;; esac done shift `expr $OPTIND - 1` # check for correct number of arguments if [ "$#" -ne 0 ]; then echo "No arguments allowed" exit 2 fi ############################################################### # guess release type ################################################################ # checks to perform for test versions # Non-production versions stop here if test "$test" = 1 then if test $exitStatus = 0 then echo "Test version passes" exit $exitStatus else echo "Test version does NOT pass due to" $exitStatus "errors" exit $exitStatus fi fi ################################################################ # checks to perform for production versions # production versions stop here if test $exitStatus = 0 then echo "Production tests passed" exit $exitStatus else echo "Production tests NOT passed due to" $exitStatus "errors" exit $exitStatus fi