diff options
Diffstat (limited to 'iraf.axe/build.sh')
-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 |