diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /unix/hlib/util.csh/iraf_latest | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'unix/hlib/util.csh/iraf_latest')
-rwxr-xr-x | unix/hlib/util.csh/iraf_latest | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/unix/hlib/util.csh/iraf_latest b/unix/hlib/util.csh/iraf_latest new file mode 100755 index 00000000..dfde7893 --- /dev/null +++ b/unix/hlib/util.csh/iraf_latest @@ -0,0 +1,91 @@ +#!/bin/csh -f +# +# IRAF_LATEST - Update the system with the latest distribution files. + +unalias grep ls + +set opt = "all" + + +if ($#argv < 1) then + echo "Usage: iraf_latest <opt>" + exit 0 +else + set opt = $1 +endif + + +# Called from Makefile, set iraf root. +set iraf = $cwd/ +source $iraf/unix/hlib/irafuser.csh + + +set REPO = `${iraf}/util/pkgrepo` +if ($?IRAFARCH) then + set arch = $IRAFARCH +else + set arch = `${iraf}/unix/hlib/irafarch.csh -actual` +endif + + +echo "iraf_latest: cwd = " $cwd + +# Figure out which binaries are required. +set files = "patch-src.tar.gz" # always need the source .... +set bins = "" +foreach b (linux linux64 macosx macintel) + if (-e "bin.$b/x_images.e") then + set bins = `echo $bins " " $b` + switch ($b) + case linux: + set files = `echo "$files patch.lnux.x86.tar.gz"` + breaksw + case linux64: + set files = `echo "$files patch.lnux.x86_64.tar.gz"` + breaksw + case macosx: + set files = `echo "$files patch.macx.uni.tar.gz"` + breaksw + case macintel: + set files = `echo "$files patch.macx.x86_64.tar.gz"` + breaksw + endsw + endif +end +echo "Updating binaries: " $bins + + +# Download the needed files to /tmp + +set FGET = "${iraf}/util/fget" +set REPO = `util/pkgrepo` +foreach f ($files) + echo -n "Downloading: $f" + ${FGET} -q -d /tmp/ $REPO/$f + if (! (-e /tmp/$f)) then + echo "" + echo "Error downloading $REPO/$f, quitting" + exit + endif + + echo -n " Unpacking ..." + tar zxf /tmp/$f + /bin/rm -f /tmp/$f + + echo " Done." +end + + +# For the initial release, the update procedures haven't yet been defined. +# This script will be replaced by the working version at the first release. + + +if ($opt == "all") then # Update everything + if (-e extern/.installed) then + echo "Update all external packages ..." + (chdir extern ; make update) + endif +endif + +echo "" +exit 0 |