#!/bin/sh # # A CVS aware script to tag a release of the CDF runII # code. # # The methodology is: # # checkout the Release package # # If the release.tags file exists for the release # to be tagged and a date was NOT specified, run # the release.tags script. # # else if the release.tags file does not exist # # if the date was NOT specified, use the date of # the last frozen release and run the changed packages # script with that date, update the Release package and # run the release.tags script. # # else # # if the date was specified, run the changed packages # script with the specified date. Then update the # Release package and run the release.tags script. # release=$1 ref_date=$2 if [ "$release" = "" ] then echo '' echo Usage: $0 release \[reference date\] exit fi UPS_SHELL=sh; export UPS_SHELL . `$UPS_DIR/bin/ups setup ups` setup cdfsoft2 development if [ "$CDFSOFT2_DIR" = "" ] then echo Please setup cdfsoft2 development before running Tag_release exit 1 fi My_dir=$BFDIST/releases/development/Release/Scripts Work_space=`${My_dir}/define_work_area` #My_dir=`${My_dir}/make_my_dir $0` cd $Work_space if [ -d Release ] then cvs -Q update Release else cvs -Q checkout Release fi if [ "" != "${ref_date}" -o ! -f Release/Releases/${release}.tags ] then if [ -z "${ref_date}" ] then maj_rel=`echo $release | cut -f1 -d'.'` min_rel=`echo $release | cut -f2 -d'.'` min_rel=`expr $min_rel - 1` base_rel="${maj_rel}.${min_rel}.0" fi # # Ensure that the midnight is properly anchored so that # the tagging process is repeatable. # mid_night=`${My_dir}/Make_midnight` $My_dir/Changed_packages "${base_rel}" $release ${mid_night} # $My_dir/changed_packages "${ref_date}" $release "$Hours_ago hours ago" # $My_dir/changed_packages "${ref_date}" $release "yesterday" cd ${Work_space} cvs -Q checkout Release fi if [ ! -f ${Work_space}/Release/Releases/${release}.newver ] then echo '' echo changed_packages script failed. exit 1 fi cd ${Work_space}/Release/Releases if [ ! -f ./${release}.tags ] then echo '' echo changed_packages script failed. exit 1 fi chmod +x ${release}.tags date > ${release}.tagged ./${release}.tags 2>&1 | tee -a ${release}.tagged date >> $release.tagged cvs -Q add $release.tagged cvs commit -m "Added $release.tagged" $release.tagged