#!/bin/bash #$Id: cvsci_run 20244 2013-03-12 22:07:45Z AxelBrandenburg $ # # This script adds a new run to the repository # and checks in all *.in files as well as material # from the data and src directories. # # if this procedure is called with an argument, # then first go into this directory and continue from there # # # if (("$#" >= 1)); then dirlist=$@ else dirlist=$PWD fi for pdir in $dirlist ; do cd "$pdir" #IL if [[ "$(basename $0)" == "tar_run_bash" ]] ; then cvsci=0 add_cmd="tar -f $PWD.a --ignore-failed-read --append" add_data_opt=('--transform s,^,data/,') add_cmd_bin="$add_cmd" tar cf $PWD.a run.in tar --delete --file=$PWD.a run.in else cvsci=1 add_cmd="cvs add" add_cmd_bin="$add_cmd -kb" add_data_opt="" fi # # set directory # CWD=$PWD dir=$(basename $PWD) # # go one up add add our run directory to cvs # if [ $cvsci ] ; then cd .. $add_cmd $dir cd $dir fi # # add directories and files to cvs # also get a copy of their time stamps before checking in # ls -l *.in *.dat *.pro src/*.local > .log $add_cmd *.in alpha_in.dat k.dat k_double.dat kvect.dat parameters.pro testfield_info.dat chemistry*.dat chem.inp tran.dat air.dat stratification.dat nnu2.dat particles_initial.dat particles_initial_header.pro .log >& /dev/null # if [ -d "data" ]; then if [ "$(basename $0)" == 'cvsci_run_bash' ] ; then $add_cmd data fi cd data $add_cmd $add_data_opt index.pro legend.dat params.log *.nml cvsid.dat varname.dat runtime.dat pc_constants.pro jobid.dat svnid.dat pdim.dat pt_positions.dat tstalk.dat particles_stalker_header.dat >& /dev/null if [ -e dim.dat ]; then $add_cmd $add_data_opt dim.dat fi if [ -e time_series.dat ]; then $add_cmd $add_data_opt time_series.dat fi if [ -e time_series.h5 ]; then $add_cmd_bin $add_data_opt time_serie fi if [ -e grid.h5 ]; then $add_cmd_bin $add_data_opt grid.h5 fi else echo "no data directory found" fi # # add alpeta.sav, if it exists # if [ -e alpeta.sav ] ; then $add_cmd $add_data_opt alpeta.sav fi # # add power spectra, if they exist # (for the time being, test existence only on a few such files) # \ls | egrep 'power.*\.dat' >/dev/null if [[ ! $status ]]; then $add_cmd $add_data_opt *power*.dat fi # # add structure functions, if they exist # (for the time being, test existence only on a few such files) # \ls | egrep 'sf.*\.dat' >/dev/null if [[ ! $status ]]; then $add_cmd $add_data_opt sf*.dat fi # # \ls | egrep 'particle_size_dist.dat' >/dev/null if [[ ! $status ]]; then $add_cmd $add_data_opt particle_size_dist.dat fi # # add testfield_info.dat file if it exists # if [[ -e testfield_info.dat ]]; then $add_cmd $add_data_opt testfield_info.dat fi # # add info about directory history # if [ -f "new_from.dir" ]; then $add_cmd $add_data_opt new_from.dir fi # if [ -f "new_to.dir" ]; then $add_cmd $add_data_opt new_to.dir fi # if [ -f "remeshed_from.dir" ]; then $add_cmd $add_data_opt remeshed_from.dir fi # # check in everything # need to take full path name, because we are still in data, # which may only be a link. # cd $CWD if [ $cvsci ]; then cvs ci -l -m "added new run: `uname -n -s`" . data # # add src stuff only if it is not a link # Do this at the very end, in case this step fails. # test -h src if [ $? ]; then $add_cmd src cd src $add_cmd *.local .build-history .moduleinfo cd .. if [ "$(basename $0)" == 'cvsci_run_bash' ] ; then cvs ci -m "added new run: `uname -n -s`" src fi fi else $add_cmd -h src/*.local src/.build-history >& /dev/null fi cd .. done