#! /bin/sh # # statusrel # # Shell script to list status of a release of software within # the BaBar code system # # Bob Jacobsen July 1995 # # # Arguments: # Number/name of release to examine # # Note: -p provides information by looking at softlinks # # -t _should_ eventually provide similar information # by looking into the */CVS/Tag files, but as yet # it does not do so # # -c with -p checks CVS for any changes # ################################################################ # process options test=0 prod=0 diff=0 #amj:FNAL: getopts has replaced getopt as recommended usage on SGI and # DECUnix. Only getopts exists in the cygnus NT system. while getopts tpvc c do case $c in p) prod=1; test=0;; t) prod=0; test=1;; c) diff=1; esac done shift `expr $OPTIND - 1` # right now, -t does not do anything (see comment at top) if [ "$test" -eq 1 ]; then echo "Sorry - this script does not yet do anything useful for -t" exit fi # check for correct number of arguments if [ "$#" -ne 1 ]; then echo "One argument required" exit 2 fi # check for release number only (i.e. not a path name) in # previous and next release names iff production version if [ "$prod" -eq 1 ]; then if (echo $1 | grep \/ >/dev/null) ; then echo Do not use path names for production releases! exit 3 fi fi ############################################################### # find the release if [ "$test" -eq 1 ]; then if [ -d $1 ]; then echo "Release found in current directory" prevrel=$1 elif [ ! -d $BFDIST/releases/$1 ]; then echo "Could not find release" $BFDIST/releases/$1 exit 3 else prevrel=$BFDIST/releases/$1 fi elif [ "$prod" -eq 1 ]; then if [ ! -d $BFDIST/releases/$1 ]; then echo "Could not find release" $BFDIST/releases/$1 exit 3 else prevrel=$BFDIST/releases/$1 fi else echo "Inconsistent options test=$test prod=$prod" exit 100 fi # go through list of packages for var in $prevrel/* do # the following lines set $1 to the last part of the pathname OIFS=$IFS IFS=/ set $var IFS=$OIFS shiftcount=`expr $# - 1` shift $shiftcount package=$1 line=`ls -lt $prevrel/$package` if (echo "$line" | grep "/packages/" >/dev/null) then OIFS=$IFS IFS=/ set $line IFS=$OIFS shiftcount=`expr $# - 1` shift $shiftcount version=$1 mostrecent=`ls -t $BFDIST/packages/$package | head -1` if [ "$version" != "$mostrecent" ]; then # \t does not seem to work on SunOS4 & SunOS5, so removed # echo "$package $version ($mostrecent more recent)" recent=" ($mostrecent more recent) " cvstag=$mostrecent else # echo "$package $version" recent="" cvstag=$version fi # check cvs if requested cvscheck="" if [ "$diff" -eq 1 ]; then if [ "`cvs -Q rdiff -s -r $cvstag -r HEAD $package | grep changed`" ]; then cvscheck=" (CVS head revision differs)" fi fi echo "$package $version $recent $cvscheck" # end of processing $package fi done