diff options
author | James E.H. Turner <jturner@gemini.edu> | 2018-01-10 19:04:33 -0500 |
---|---|---|
committer | James E.H. Turner <jturner@gemini.edu> | 2018-01-10 19:04:33 -0500 |
commit | baf535457e380ff613fadb0941e986041efc0e33 (patch) | |
tree | 4aa7449ba540d8bcf443a4eb9992ed4df0c0efa4 | |
parent | b4aca80eb2022bde75cbde4fce99acf236b71749 (diff) | |
download | astroconda-iraf-baf535457e380ff613fadb0941e986041efc0e33.tar.gz |
Force destination of bin.IRAFARCH (which is what the slitless code expects);
replace sed cmd with a more portable awk version; check for error conditions.
-rw-r--r-- | iraf.axe/build.sh | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/iraf.axe/build.sh b/iraf.axe/build.sh index 58b8259..bfa5f05 100644 --- a/iraf.axe/build.sh +++ b/iraf.axe/build.sh @@ -3,8 +3,10 @@ set -e -# Get the target stsdas/bin.$IRAFARCH installation path from IRAF. -# The aXe build does not actually rely on IRAF apart from this. +# Get the stsdas installation path from IRAF (just to avoid hard-wiring +# information on the iraf_extern directory structure here). The aXe build does +# not actually rely on IRAF apart from determining this and $IRAFARCH (so that +# it can install binaries to the right directory). . setup_iraf.sh rm -rf irafdir mkdir irafdir @@ -13,16 +15,19 @@ echo xterm | mkiraf > tmp touch .hushiraf cl > tmp << ARF cd stsdas -cd bin pwd -P logout ARF -stbindir=$(sed -Ee 's|e?cl>[ \t]*||g' tmp) -stdir=$(dirname "$stbindir") +stdir=$(awk '{ gsub(/e?cl>[ \t]*/, ""); print }' tmp) +stbindir=${stdir}/bin.${IRAFARCH} cd .. -if ! echo "$stbindir" | grep -q 'stsdas/bin'; then - echo "Failed to determine stsdas/bin path from IRAF" >&2 +# Make sure we've determined a valid installation path. +if ! echo "$stdir" | grep -q '/stsdas$'; then + echo "Failed to determine stsdas path from IRAF" >&2 + exit 1 +elif [ ! -w "$stbindir" ]; then + echo "Cannot install to $stbindir" >&2 exit 1 fi |