#!/bin/sh # # Updates the rcp data base in the repository # Cloned from validate_short export PWD ; PWD=`/bin/pwd` # for tcl scripts using $env(PWD) if [ -z "${My_dir}" ] then export My_dir; My_dir=$BFDIST/releases/development/Release/Scripts fi Dev_dir=$BFDIST/releases/development export CT_ULIMITF CT_ULIMITF=20000 ulimit -S -f ${CT_ULIMITF} ulimit -S -t 1600 ulimit -S -c 0 # We will need to overwrite various files via >, etc. unset noclobber # gmake test defaults. Override locally where appropriate export CT_DIFFLINES; CT_DIFFLINES=10 export CT_DELTBINS; CT_DELTBINS=YES release=${1} [ -z "${release}" ] && release=development db_path=${2} [ "${db_path}" = "" ] && db_path=official executable="${3}" echo "Update_rcpdb: Updating rcpdb with ${release} beginning at `date`" echo " " echo "Update_rcpdb: sourcing ~cdfsoft/cdf2.shrc file" cdf_root=`/bin/csh -f -c "echo ~cdfsoft"` unset PRODUCTS . ${cdf_root}/cdf2.shrc echo "Update_rcpdb: setting up cdfsoft2 ${release}" setup cdfsoft2 ${release} setup python v2_1 echo "Update_rcpdb: Fetching rcpdb package" cvsroot cdfw Work_space=`$CDFSOFT2_DIR/Release/Scripts/define_work_area` echo "Using ${Work_space}" [ -d ${Work_space}/rcpdb ] && rm -r ${Work_space}/rcpdb cd $Work_space cvs -d $CVSROOT -Q checkout rcpdb if [ -d ${Work_space}/rcpdb/official ] then export RCP_DB_NAMES_FILE; RCP_DB_NAMES_FILE=${Work_space}/rcpdb/dbnames.txt export RCP_FILESYSTEMDB_WRITABLE_DIR; RCP_FILESYSTEMDB_WRITABLE_DIR=${Work_space}/rcpdb export RCP_DATABASE_PATH; RCP_DATABASE_PATH=${db_path}/FileSystemDB export TCL_TAG; TCL_TAG=anyTag else echo "Failed to checkout rcpdb package" echo " Cannot update - Exiting" exit 1 fi if [ -n "${executable}" ] then executable=`eval echo ${executable}` ${executable} else reltest=`echo $release | sed 's/\./\\\./g'` # escape . for grep Updated=`grep " ${reltest} " ${Work_space}/rcpdb/official/* | wc -l` if [ ${Updated} -gt 0 ] then echo "Update_rcpdb: rcpdb has already been updated for this release" else echo "Update_rcpdb: changing directory to scratch area" mkdir -p $VAL_DATA_DIR/tmp cd $VAL_DATA_DIR/tmp rm -f core echo " " echo "Update_rcpdb: running cdfSim at `date`" echo " " #################################################################### # The following code reduces the number of events to 1 in an effort # to reduce the time to run this. # # This is not a truew simulation. We only need enough data to # give the following programs something to run on. This will cause # them to update the data in the rcp database as pointed to by the # RCP environment variables. #################################################################### if [ -r ${CDFSOFT2_DIR}/SimulationMods/test/validate_cdfSim.tcl ] then cat ${CDFSOFT2_DIR}/SimulationMods/test/validate_cdfSim.tcl > \ ${Work_space}/validate_cdfSim.tcl else echo "Update_rcpdb: SimulationMods/test/validate_cdfSim.tcl not found." echo ' Cannot continue. Exiting!' echo "Update_rcpdb: FAILED" fi cdfSim_NUM_EVENTS=1; export cdfSim_NUM_EVENTS export CDFPVLI ; CDFPVLI=${GENERATORMODS_DIR}/examples/isajet/top175.val if [ -r ${Work_space}/validate_cdfSim.tcl ] then cdfSim ${Work_space}/validate_cdfSim.tcl -b else echo "${Work_space}/test/validate_cdfSim.tcl not found. Cannot execute cdfSim." exit 1 fi echo " " echo "Update_rcpdb: running ProductionExe at `date`" echo " " if [ -r ${CDFSOFT2_DIR}/Production/validate_Production.tcl ] then rm -f histos.rz time \ ProductionExe \ ${CDFSOFT2_DIR}/Production/validate_Production.tcl else echo "Production/validate_Production.tcl not found. Cannot execute ProductionExe." fi echo "Update_rcpdb: running AC++Dump at `date`" echo " " if [ -r $PROJECT_DIR/FrameMods/dump/validate_AC++Dump.tcl ] then AC++Dump $PROJECT_DIR/FrameMods/dump/validate_AC++Dump.tcl else echo "FrameMods/dump/validate_AC++Dump.tcl not found. Cannot update ProductionExe." fi echo "Update_rcpdb: running stnmaker.exe at `date`" echo " " if [ -r ${CDFSOFT2_DIR}/Stntuple/test/stnmaker/validate_stnmaker_mc.tcl ] then time stnmaker.exe ${CDFSOFT2_DIR}/Stntuple/test/stnmaker/validate_stnmaker_mc.tcl -b else echo "${CDFSOFT2_DIR}/Stntuple/test/stnmaker/validate_stnmaker_mc.tcl not found. Cannot update stnmaker.exe." fi fi fi # CONVERT between control v1 and v2 cd ${Work_space}/rcpdb if [ -f "${Dev_dir}/rcp/python/convert_1_2.py" ] then for SUB in level3 official do if [ ! -f ${SUB}/control_v2.dat -o \ ${SUB}/control.dat -nt ${SUB}/control_v2.dat ] then [ -f ${SUB}/control_v2.dat ] && mv ${SUB}/control_v2.dat \ ${SUB}/control_v2.bak if ${Dev_dir}/rcp/python/convert_1_2.py \ ${Work_space}/rcpdb/${SUB} then printf " OK - converted control v1 to v2 \n" touch ${SUB}/control.dat rm ${SUB}/control_v2.bak else printf "\n OOPS - failed to convert control v1 to v2 \n\n" mv ${SUB}/control_v2.bak ${SUB}/control_v2.dat fi elif [ ${SUB}/control_v2.dat -nt ${SUB}/control.dat ] then mv ${SUB}/control.dat ${SUB}/control.bak if ${Dev_dir}/rcp/python/convert_2_1.py \ ${Work_space}/rcpdb/${SUB} then printf " OK - converted control v2 to v1 \n" touch ${SUB}/control_v2.dat else printf "\n OOPS - failed to convert control v2 to v1 \n\n" mv ${SUB}/control.bak ${SUB}/control.dat fi if [ `cat ${SUB}/control.dat | wc -l` -lt 1000 ] then printf "\n OOPS - Error converting v2 to v1 \n\n" mv ${SUB}/control.bak ${SUB}/control.dat fi rm -f ${SUB}/control.bak fi done else printf "\n OOPS - no file ${Dev_dir}/rcp/python/convert-1-2.py \n" fi new_files=`cvs -d $CVSROOT status -l | grep ^? | tr '?' ' '` if [ ! -z "$new_files" ] then num_files=`echo $new_files | wc -w` printf "Update_rcpdb: adding $num_files new files\n" cvs -d $CVSROOT add $new_files fi printf "Update_rcpdb: recur_Update_rcpdb ${release} `pwd`\n" ${My_dir}/recur_Update_rcpdb ${release} `pwd` printf "Update_rcpdb: cvs commit\n" cvs -d $CVSROOT commit -m "Update_rcpdb with ${release}" cdf_test=`echo ${SRT_DIST} | grep $HOME` if [ -z "${cdf_test}" ]; then echo "" echo "Update_rcpdb: Skipping update of local rcp database" echo "" exit 2 fi echo "Update_rcpdb: updating local rcp database" [ -d $SRT_DIST/rcpdb ] && rm -r $SRT_DIST/rcpdb cd $SRT_DIST cvsroot cdf cvs -d $CVSROOT -Q checkout rcpdb echo " " echo "Update_rcpdb: Update of rcpdb with ${release} finished at `date`" rm -f ${Work_space}/validate_cdfSim.tcl rm -r ${Work_space}/rcpdb exit 2003 10 24 kreymer Escaped the . in release for rerun test Restrict test to official/control.dat Made cvs checkout quiet mkdir -p $VAL_DATA_DIR/tmp