#! /bin/sh # # auditrel # # Shell script to 'audit' a release of software within the # the BaBar code system # # (*) means the preceeding sentence is not yet implemented. # # Bob Jacobsen Sept 1994 # # Checks done: # # 'gmake' is up to date. # (Production versions only) # All products (libraries and executables) are physically there # (i.e. are not links) (*) # All packages are in the production area (*) # All file dates are consistent. (*) # No file in a package is younger than the release creation date # (i.e. has been touched since) # Each package passes its own auditpkg (*) # All known packages are present. # No extra packages are present # # # Options: # -v Tells you the version, then quits. # -p This is a production version, so real libraries # should exist, etc. Lives in the $BFDIST/releases directory. # -t This is a test version, and therefore # do fewer tests # # 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 prodPackages="colias CLHEP HepTuple SoftRelTools farfalla stdhep Framework FrameExample BaBar beget" prodArch="SunOS4 AIX3 SunOS5 OSF1V3 HP-UX9" 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;; esac done shift `expr $OPTIND - 1` ############################################################### # guess release type (*) # if in BFDIST/release/*, is production ################################################################ # checks to perform for test versions if gmake -qs then # echo "Make is up to date" : else echo "Make is _not_ up to date" exitStatus=`expr $exitStatus + 1` fi # Non-production releases stop here if test "$test" = 1 then if test $exitStatus = 0 then echo "Test release passes" exit $exitStatus else echo "Test release does NOT pass due to" $exitStatus "errors" exit $exitStatus fi fi ################################################################ # checks to perform for test versions # make a list of packages dirlist=`/bin/ls -Fp |grep '[@/]'|grep -v tmp|grep -v bin|grep -v lib|grep -v include|grep -v doc| grep -v man| tr -d '/@' |sort` # check table of contents for var in $dirlist do if (echo $prodPackages | grep $var >/dev/null) then # $var is a valid package directory - do further checks : # end of package checks else echo "Directory" $var" present, should not be in production release" exitStatus=`expr $exitStatus + 1` fi done for var in $prodPackages do if (echo $dirlist | grep $var >/dev/null) then : else echo "Package" $var" not present, should be in production release" exitStatus=`expr $exitStatus + 1` fi done # check bin and lib architecture list binlist=`/bin/ls bin` for var in $binlist do if (echo $prodArch | grep $var >/dev/null) then : else echo "Bin directory" $var" present, should not be in production release (warning only)" fi done for var in $prodArch do if (echo $binlist | grep $var >/dev/null) then : else echo "Bin directory" $var" not present, should be in production release (warning only)" fi done liblist=`/bin/ls lib` for var in $liblist do if (echo $prodArch | grep $var >/dev/null) then : else echo "Lib directory" $var" present, should not be in production release (warning only)" fi done for var in $prodArch do if (echo $liblist | grep $var >/dev/null) then : else echo "Lib directory" $var" not present, should be in production release (warning only)" fi done if test $exitStatus = 0 then echo "Production tests passed" exit $exitStatus else echo "Production tests NOT passed due to" $exitStatus "errors" exit $exitStatus fi