Skip to content

AFNI and NIfTI Server for NIMH/NIH/PHS/DHHS/USA/Earth

Sections
Personal tools
You are here: Home » AFNI » Documentation » Misc Items » afni_download » via_updater

via_updater

Document Actions
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

Created by Alex Clark
Last modified 2005-08-09 16:25
 

Powered by Plone

This site conforms to the following standards: