#!/bin/sh # # Copy the Release definitions to another release and place them in # the repository. # # Arguments: # # Existing_release Name of the existing release to be # "Cloned" # # New_release Name to be given to the "Clone" # # revision OPTIONAL - Tag on the Release package # containing the revision of the the # release to be "Cloned" # This is added as a means to avoid the # difficulty of building a release from # other than the latest version of the # Release package # Existing_release=$1 New_release=$2 revision=$3 # Set Pre to echo to test modifications, to '' to run Pre='' #Pre=echo UPS_SHELL=sh; export UPS_SHELL . `$UPS_DIR/bin/ups setup ups` #setup cdfsoft2 development # Determine work area (temp space) if [ -z "${My_dir}" ] then My_dir=${SRT_DIST}/releases/development/Release/Scripts; export My_dir fi [ `${My_dir}/which cvs | wc -w` -gt 1 ] && setup cvs v1_11_1p1 work_space=`${My_dir}/define_work_area` CDF_WRITE=`${My_dir}/Find_cvs_root Release|cut -f2 -d','` # cd work_area cd $work_space # get fresh Release stuff [ -d Release ] && rm -r Release if [ "${revision}" != "" ] then cvs -Q -d ${CDF_WRITE} checkout -r ${revision} Release else cvs -Q -d ${CDF_WRITE} checkout Release/Releases fi # cd to Release area cd Release/Releases if [ ! -f ${Existing_release}.newrel ] then echo "" echo $Existing_release does not exist - exiting exit 1 fi if [ -f ${New_release}.newrel ] then echo "" echo $New_release exists - exiting exit 1 fi touch ${New_release}.newrel # copy existing files to define new release #for f in newrel #do # cp ${Existing_release}.${f} ${New_release}.${f} #done while read package version do [ -z ${version} ] && continue echo "$package $version" >> ${New_release}.newrel done < ${Existing_release}.newrel # put release info back into repository $Pre cvs -Q add ${New_release}.* $Pre cvs -Q commit -m "Cloned ${New_release} from ${Existing_release}" echo "" echo Successfully cloned ${New_release} from ${Existing_release} if [ "${Pre}" = "" ] then cd $work_space rm -r Release else diff $Existing_release.newrel $New_release.newrel cd $work_space rm -r Release fi