From 07f295cdeafea52658f09dc0cc11f954d03c17df Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 19 Oct 2016 13:07:40 -0300 Subject: Support uninstallation of IRAF packages from extern.pkg. --- scripts/ac_config_iraf_pkg | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'scripts/ac_config_iraf_pkg') diff --git a/scripts/ac_config_iraf_pkg b/scripts/ac_config_iraf_pkg index 0863a86..c1f3e09 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 @@ -61,7 +68,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 -- cgit From 46e0e458820ad0876c8d045109b20ce2171756c0 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 19 Oct 2016 21:32:46 -0300 Subject: Create extern.pkg if it doesn't already exist, for better foolproofing; we already check that ur_extern.pkg exists, so this is unlikely to lead to extern.pkg being written to weird places when invoked improperly (not a big deal anyway). --- scripts/ac_config_iraf_pkg | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts/ac_config_iraf_pkg') diff --git a/scripts/ac_config_iraf_pkg b/scripts/ac_config_iraf_pkg index c1f3e09..f41f943 100755 --- a/scripts/ac_config_iraf_pkg +++ b/scripts/ac_config_iraf_pkg @@ -61,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 -- cgit