#!/bin/sh # # A wrapper around the Apply_patches script to apply the # "official" patches to a frozen and build the resulting # test release. # usage(){ echo 'Usage: Make_patched_release <-n> base_release directory patched_release_name' echo " Where: base_release is the release upon which the patches are to be applied. directory is the directory in which the patched release is to be built. patched_release_name is the name (sub-directory) of the patched release. the optional -n turns off dependency detection in Apply_patches." } # # At this time only one option is supported, but # ---------------------------------------------- case $1 in -*) option="$1" shift ;; esac if [ "${option}" = '-n' ] then dependencies=no elif [ "${option}" != "" ] then echo "ERROR: option ${option} is not supported" error=1 else dependencies=yes fi #set -x #set -v Base_release=$1 directory=$2 patched_release_name=$3 Patches_pkg=Release Patches_dir=patches Patch_file_name=${Base_release}.patches if [ "${Base_release}" = "" ] then echo "" echo "The base release MUST be specified." error=1 fi if [ "${directory}" = "" ] then echo "" echo "The base directory for the patched release MUST be specified." error=1 fi if [ "${patched_release_name}" = "" ] then echo "" echo "The name of the patched release MUST be specified." error=1 fi if [ "${error}" = "1" ] then usage exit fi if [ ! -d $BFDIST/releases/${Base_release} ] then echo "$Base_release does not exist" exit fi if [ ! -d ${directory} ] then mkdir -p ${directory} if [ ! -d ${directory} ] then echo "Failed to create $directory." exit fi echo "${directory} not found - created" fi UPS_SHELL=sh; export UPS_SHELL . `$UPS_DIR/bin/ups setup ups` setup cdfsoft2 ${Base_release} cd ${directory} base_dir=`pwd` Patches_scripts=${base_dir}/${Patches_pkg}/Scripts if [ -d ${patched_release_name} ] then rm -r ${patched_release_name} fi if [ -d ${Patches_pkg} ] then rm -r ${Patches_pkg} fi cvs -Q checkout ${Patches_pkg} if [ ! -r ${Patches_pkg}/${Patches_dir}/${Patch_file_name} ] then echo "" echo "unable to find ${Patches_pkg}/${Patches_dir}/${Patch_file_name}" echo "which should contain the \"official\" patches for ${Base_release}" exit fi chmod +x ${Patches_scripts}/* #relnew ${patched_release_name} newrel -t ${Base_release} ${patched_release_name} srt_setup SRT_BASE_RELEASE=${Base_release} # cd ${patched_release_name} ; srt_super_init; srt_setup -aS if [ "${dependencies}" = "no" ] then app_opt='-n' else app_opt='' fi ${Patches_scripts}/Apply_patches ${app_opt} ${Base_release} \ ${base_dir} ${patched_release_name} \ ${base_dir}/${Patches_pkg}/${Patches_dir}/${Patch_file_name} cd ${patched_release_name} gmake refresh gmake nobin