#!/bin/csh # AFNI_UPDATER: Script to update AFNI binary distribution # 0) Save this script in your home directory into a file named "AFNI_UPDATER" # 1) Mark this script as executable by typing "chmod ugo+x AFNI_UPDATER" # 2) Edit this file and set SYSTYPE to name of distribution you want to get # Currently available binaries are [as of Dec 2003] # altix_icc linux_gcc33_64 macosx_10.3 # sgi10k_6.5_gcc linux_gcc32 macosx_10.3_G5 solaris29_suncc # 3) Also, set SAVEDIR to the directory where to put the AFNI binary files # 4) Run this script while "in" your home directory by typing "./AFNI_UPDATER" # 5) In the future, to update your AFNI, just do step 4 again. Only changed # or new files will be altered in SAVEDIR. set SYSTYPE = macosx_10.3 set SAVEDIR = ${HOME}/qbin # Get the tar+gzip archive that we want echo "++ FTP-ing archive ${SYSTYPE}.tgz from afni.nimh.nih.gov" /usr/bin/ftp -n afni.nimh.nih.gov << EEEEE user anonymous updatescript binary passive cd tgz get ${SYSTYPE}.tgz bye EEEEE if( ! -f ${SYSTYPE}.tgz )then echo "** Fatal Error: Could not fetch file ${SYSTYPE}.tgz" exit 1 endif ls -l ${SYSTYPE}.tgz echo "++ Unpacking archive into directory ./$SYSTYPE" gzip -dc ${SYSTYPE}.tgz | tar xf - /bin/rm -f ${SYSTYPE}.tgz if( ! -d $SAVEDIR )then echo "++ Making directory $SAVEDIR" /bin/mkdir -p $SAVEDIR endif cd $SAVEDIR ; set SDIR = `pwd` ; cd - echo "++ Moving changed/new files from $SYSTYPE to $SDIR" cd $SYSTYPE @ ttt = 0 foreach fname ( `find . -print` ) if( -f $fname ) then if( -f $SDIR/$fname ) then cmp -s $SDIR/$fname $fname set mmm = $status else set mmm = 1 endif if( $mmm ) then /bin/mv -f $fname $SDIR/$fname @ ttt = $ttt + 1 endif else if( -d $fname ) then if( ! -d $SDIR/$fname ) then /bin/mkdir -p $SDIR/$fname endif endif end echo "++ Put ${ttt} files from $SYSTYPE to $SDIR" cd - /bin/rm -rf ${SYSTYPE} exit 0