#!/bin/csh 

echo "This release script must be run from the root directory"
echo "of the module.  So you would checkout a copy of it,"
echo "make changes, commit changes, then run this release script"  
sleep 1

if ( ! -d ./plot_read ) then 
   exit
endif

# check to see if there are any files that have not been committed.
set x=`cvs update | grep -v '^\?' | xargs`
if ( "$x" != "" ) then 
    echo "The following files need to be committed:"
    echo $x
    exit
endif

set versiondb = "./plot_read/hydra_code_version.pro"

if ( ! -f $versiondb ) then
   echo "Can't find hydra_code_version.pro, are you in the root directory?"
   exit
endif

echo "Modifying $versiondb"

set vers = `./get_current_version module`
set new_vers = `echo "$vers + 0.01" | bc`

./set_current_version module $new_vers
cvs commit -m "updated version table" $versiondb

echo "New Version number is $new_vers.  "
echo "Please make a note of the changes in emacs."

emacs ./version_history.txt 
cvs commit -m "" ./version_history.txt

set tt = `echo $new_vers | sed 's/\./_/'`    #DISK SPACE
set tt = v$tt

cvs tag $tt

set public_dir = /opt/hydra/papco/

cd $public_dir
cvs checkout -r $tt -d polar_hydra papco_hydra_module

#echo "Compiling Papco..."
#cd 
#idl compile_papco



