diff options
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 |