#! /bin/sh # # freezerel # # Shell script to 'freeze' a new release of software within # the BaBar code system. # # Bob Jacobsen Sept 1994 # # This should be invoked from a production release # directory after all build steps are complete. # # Function: # Check in correct directory ($BFDIST/releases/) (*) # Mark files read only as appropriate # Record the status in the ReleaseLog # # Items with a (*) are not yet implemented # # Options: # -v Tells you the version, then quits. # -p This will be a production version. # This must be explicitly specified, even though -t is not allowed. # # No arguments # ################################################################ # process options 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;; esac done shift `expr $OPTIND - 1` if [ "$prod" -ne 1 ]; then echo "-p option is currently required" exit 2 fi # check for correct number of arguments if [ "$#" -ne 0 ]; then echo "No arguments allowed" exit 2 fi ############################################################### # get name from current directory name line=`pwd` OIFS=$IFS IFS=/ set $line IFS=$OIFS shiftcount=`expr $# - 1` shift $shiftcount release=$1 # set permissions find . -perm -100 -exec chmod 555 {} \; find . ! -perm -100 -exec chmod 444 {} \; find . -type -d -exec chmod 555 {} \; # write log chmod 744 ReleaseLog echo "===========================================" >> ReleaseLog echo " Freezing release" $release "in " `pwd` >> ReleaseLog echo " on " `date` >> ReleaseLog echo " by " `whoami` " at " `hostname` >> ReleaseLog echo >> ReleaseLog echo "-------------------------------------------" >> ReleaseLog ls -lt >> ReleaseLog echo "-------------------------------------------" >> ReleaseLog ls -lt lib/*/* >> ReleaseLog echo "-------------------------------------------" >> ReleaseLog ls -lt bin/*/* >> ReleaseLog echo "-------------------------------------------" >> ReleaseLog printenv >> ReleaseLog echo "===========================================" >> ReleaseLog chmod 444 ReleaseLog chmod 555 .