diff options
author | jehturner <jturner@gemini.edu> | 2016-10-21 14:08:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-21 14:08:46 -0400 |
commit | dfc0b0c365e132a8c39c92f0fd17b1a4cf478fb1 (patch) | |
tree | ba02b0e2871b795d5740b0a63b78942d15d6d3d8 /scripts/ac_config_iraf_pkg | |
parent | 70e4227f580a7464f413d8ac7242d90af8004a68 (diff) | |
parent | 46e0e458820ad0876c8d045109b20ce2171756c0 (diff) | |
download | astroconda-iraf-helpers-dfc0b0c365e132a8c39c92f0fd17b1a4cf478fb1.tar.gz |
Merge pull request #1 from jehturner/master
IRAF package build & install compatibility fixes for Linux & old OS python versions, package uninstallation support & an install robustness improvement.
Diffstat (limited to 'scripts/ac_config_iraf_pkg')
-rwxr-xr-x | scripts/ac_config_iraf_pkg | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/scripts/ac_config_iraf_pkg b/scripts/ac_config_iraf_pkg index 0863a86..f41f943 100755 --- a/scripts/ac_config_iraf_pkg +++ b/scripts/ac_config_iraf_pkg @@ -9,12 +9,15 @@ script_dir=`dirname "$0"` st=1 -unset name +unset name remove flags while [ -n "$1" ]; do case "$1" in -h) st=0; break ;; + --remove) + remove=1 + ;; -*) st=1; break ;; @@ -30,10 +33,14 @@ while [ -n "$1" ]; do done if [ -n "$st" ]; then - echo "Usage: `basename "$0"` NAME (normally invoked by \"conda install\")" + echo "Usage: `basename "$0"` [--remove] NAME " >&2 + echo " (normally invoked automatically by \"conda install\")" >&2 + echo >&2 exit $st fi +[ -n "$remove" ] && flags="${flags}${flags:+ }--remove" + # If the shell environment isn't configured by "conda install" as expected, try # falling back to Anaconda's run-time path variables to support user invocation. if [ -z "$PREFIX" ]; then @@ -54,6 +61,9 @@ if [ ! -d "$PREFIX" -o ! -w "$PREFIX" ]; then exit 1 fi +# Create any new file with the expected permissions: +umask 022 + # The Python script for updating extern.pkg must be invoked as follows because # (if directly executable) conda insists on changing its interpreter path to # one in the env that may not exist, since IRAF packages do not require python @@ -61,7 +71,8 @@ fi # depending on other packages. Both the LSB and MacOS define Python in /usr/bin # as standard, avoiding any dependence on the state of the installation. -if /usr/bin/python "$script_dir/ac_update_extern_pkg" "$PREFIX" "$name"; then +if /usr/bin/python "$script_dir/ac_update_extern_pkg" $flags "$PREFIX" "$name" +then if [ $inst = 1 ]; then echo "Updated extern.pkg file" >> "$PREFIX/.messages.txt" else |