From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- unix/hlib/util.csh/iraf_latest | 91 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100755 unix/hlib/util.csh/iraf_latest (limited to 'unix/hlib/util.csh/iraf_latest') 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 " + 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 -- cgit