#! /bin/sh # script to make a patch release, based on the HOWTO of Art Kreymer # # 20001013 Hartmut Stadie THIS=make_patch_release NEEDEDHOST=b0dap30.fnal.gov NEEDEDUSER=cdfsoft #packages needed to build the bins NEEDEDPACKAGES="Consumer DBANA FrameMods RootMods SvxDaqMods" #Log into the cdfsoft account on b0dap30 if [ `whoami` != ${NEEDEDUSER} ] then echo "${THIS}: you need to be locked in as cdfsoft to run the script." exit 1 fi if [ `hostname` != ${NEEDEDHOST} ] then echo "${THIS}: you need to run this script on b0dap30.fnal.gov." exit 1 fi if [ $# -ne 3 ] then echo "${THIS}: usage: ${THIS} ." exit 1 fi PATCHFILE=$1 BASERELEASE=$2 PATCHRELEASE=$3 . ~cdfsoft/cdf2.shrc setup cdfsoft2 ${BASERELEASE} cd ; cd ~cdfsoft/dist/cdfsoftb0 #(copy the patch file to 3.9.0b.patches locally) cp ${PATCHFILE} ${PATCHRELEASE}.patches echo -n "${THIS}: creating new release ${PATCHRELEASE}. Applying patches..." ${SRT_DIST}/releases/development/Release/Scripts/Apply_patches ${BASERELEASE} ${SRT_DIST}/cdfsoftb0 ${PATCHRELEASE} ${PATCHRELEASE}.patches > ${PATCHRELEASE}.log 2>&1 if [ `grep -c '\[' ${PATCHRELEASE}.log` -gt 0 ] then echo " FAILED." exit 1 else echo " done." fi cd ${PATCHRELEASE} # build libs echo -n "${THIS}: building libraries for release ${PATCHRELEASE}..." (time gmake nobin) > gmake.log 2>&1 if [ `grep -c 'gmake\[' gmake.log` -gt 0 ] then echo " FAILED." exit 1 else echo " done." fi # adding packages that are needed for b0bins echo -n "${THIS}: adding packages needed for the b0 binaries..." for PKG in ${NEEDEDPACKAGES} do if [ -d ${PKG} ] then continue else #echo "${THIS}: adding package ${PKG}." addpkg -Q ${PKG} >> additionalpackages.log 2>&1 fi done echo " done" if [ `grep -c '\[' additionalpackages.log` -gt 0 ] then echo " FAILED." exit 1 else echo " done." fi #build binaries cp ~cdfsoft/dist/cdfsoftb0/b0bins . echo -n "${THIS}: building binaries for release ${PATCHRELEASE}..." (time ./b0bins) > b0bins.log 2>&1 if [ `grep -c 'gmake\[' b0bins.log` -gt 0 ] then echo " FAILED." exit 1 else echo " done" fi #Test the patch release, with KOR and other tests cp ~cdfsoft/dist/cdfsoftb0/b0validate . echo -n "${THIS}: validating release ${PATCHRELEASE}..." (time ./b0validate ${PATCHRELEASE} ${BASERELEASE}) > b0validate.log 2>&1 if [ `grep -c 'FAILED' b0validate.log` -gt 0 ] then echo " FAILED." exit 1 else echo " done" fi #echo "${THIS}: declaring ${PATCHRELEASE} to ups." #Declare this release to ups : cp ../${BASERELEASE}/ups/cdfsoftb0.table ups/ echo "ups declare cdfsoftb0 ${PATCHRELEASE} -r `pwd` -m cdfsoftb0.table -M ups -z ${SRT_DIST}/../upsdb -2" > declare.csh #source declare.csh #When ready to make this the default for use on shift : echo "ups declare -c cdfsoftb0 ${PATCHRELEASE} -z ${SRT_DIST}/../upsdb -2" > current.csh #source current.csh echo "${THIS}: created new patch release successfully." echo "${THIS}: use declare.csh to declare it to cvs and current.csh to make it current."