via_updater
The UPDATER script is an easy way
to get AFNI binaries. The script is supposed to be
self-documenting (in its comments). Here is a copy; the link above
will let you get the script directly.
#!/bin/csh
# UPDATER: Script to update AFNI binary distribution
# 0) Save this script in your home directory into a file named "UPDATER"
# 1) Mark this script as executable by typing "chmod ugo+x UPDATER"
# 2) Edit this file and set SYSTYPE to name of distribution you want to get
# Currently available binaries are [as of Dec 2003]
# linux_gcc32 linux_glibc22 macosx_10.3 macosx_10.2 solaris27_gcc
# solaris28_gcc sgi10k_6.5
# 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 "./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
cd AFNI/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