#!/bin/sh # # Routine to generate and update release patch files for # either "official" or test patches. # # usage() { echo "Usage:" echo " `basename $0` release filespec revision out-loc" echo "" echo " where:" echo " release is the release for which the patch os prepared" echo "" echo " filespec is the package/file containing the patch" echo " as Level3/Level3/aaaa.hh or @filespec to define" echo " a file containing a list of filename revision pairs" echo " echo " revision is the revision information defining the" echo " the exact cvs revision representing the patch." echo "" echo " out-loc is the directory or package/directory to" echo " contain the updated release.patches file." echo "" echo " If no revision information is given, the is assumed to" echo " reference the file at the head of the cvs repository." echo " If out_loc is not specified, the current directory is" echo " assumed. The package will be tagged in a manner that" echo " reflects a change to the files referenced only." echo "" echo " If the '@filespec' notation is used the revision is not expected." echo "" echo " See \$BFDIST/releases/development/Release/README for more information" echo "" } at_file=no release=$1 filespec=$2 if [ echo $filespec | cut -c1`" = '@' ] then if [ "$4" != "" ] then usage exit 1 else out_loc=$3 at_file=yes fi else revision=$3 out_loc=$4 fi if [ "${out_loc}" = "" ] then out_loc=`pwd` fi if [ "`echo ${revision}|cut -c1`" != '-' ] then revision="-r $revision" fi if [ "`echo ${out_loc} | cut -c1`" = '/' ] then if [ ! -d ${out_loc} ] then usage exit 1 fi else if [ ! -d ${out_loc} ] then echo "" echo ${out_loc} not found - attempting cvs checkout ... echo "" cvs -Q checkout `echo $out_loc|cut -f1 -d '/'` if [ ! -d $out_loc ] then echo $out_loc not found in repository usage exit 1 fi fi fi old_cwd=`pwd` cd ${out_loc} if [ ! -d CVS ] then echo ${out_loc} is not a cvs entity echo It will NOT be added to the cvs repository echo "" cvs_commit=no else echo ${out_loc} is a cvs entity. echo It will be updated in the cvs repository. echo "" cvs_commit=yes if [ -f ${release}.patches ] then echo ${out_loc}/${release}.patches exists echo Will be updated in the repository. echo "" cvs_add=no else echo ${out_loc}/$release.patches does not exist. echo It will be added to the repository echo "" touch $release.patches cvs add $release.patches fi fi cd ${old_cwd}