From 0d7e8294cffe2de78bc1cacb111bd0bbc61a219f Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Tue, 10 Apr 2018 15:06:39 +0200 Subject: [PATCH] Make sure that old library path is kept on Mac OS X (#2420) --- ChangeLog | 3 ++- NEWS | 4 ++-- doc/source/admin/release_history/1.6.rst | 3 ++- src/ctools-init.csh | 2 +- src/ctools-init.sh | 2 +- src/ctools-setup.in | 61 +++++++++++++++++++++---------------------------------------- 6 files changed, 29 insertions(+), 46 deletions(-) diff --git a/ChangeLog b/ChangeLog index 887e1e1..7965091 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,9 @@ -2018-04-09 +2018-04-10 * Version 1.6.0 released ======================== + Keep existing library path in installation script on Mac OS X (#2420) Add show_rmf.py example script Allow specifying of input sky map in ctskymap (#2311) Add ras() and decs() methods to csobsinfo (#2313) diff --git a/NEWS b/NEWS index f388f70..c1d5783 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ New Features and Important Changes in ctools 1.6.0 -9 April 2018 +10 April 2018 Introduction @@ -11,7 +11,7 @@ ctools release with respect to the precedent release. Configuration ------------- -None +Keep existing library path in installation script on Mac OS X (#2420) Python interface diff --git a/doc/source/admin/release_history/1.6.rst b/doc/source/admin/release_history/1.6.rst index 08bac5a..c9ec0eb 100644 --- a/doc/source/admin/release_history/1.6.rst +++ b/doc/source/admin/release_history/1.6.rst @@ -16,7 +16,8 @@ In particular, this release provides: Bug fixes --------- -* ... +* [`2420 `_] - + Keep existing library path in installation script on Mac OS X Improvements diff --git a/src/ctools-init.csh b/src/ctools-init.csh index 4d5d06d..efa10b8 100755 --- a/src/ctools-init.csh +++ b/src/ctools-init.csh @@ -1,4 +1,4 @@ -# Filename: ctools-init.csh +# Filename: ctools-init.csh # Description: C-shell flavor initialization for ctools # runs ctools-setup to generate a temporary csh script # tailored specifically to this user and ctools diff --git a/src/ctools-init.sh b/src/ctools-init.sh index 285c2e2..5e99240 100755 --- a/src/ctools-init.sh +++ b/src/ctools-init.sh @@ -1,4 +1,4 @@ -# Filename: ctools-init.sh +# Filename: ctools-init.sh # Description: Bourne-shell flavor initialization for ctools. # Runs ctools-setup to generate a sh script tailored # specifically to this user and ctools installation, diff --git a/src/ctools-setup.in b/src/ctools-setup.in index 0a4c654..5c460c8 100644 --- a/src/ctools-setup.in +++ b/src/ctools-setup.in @@ -1,5 +1,4 @@ -#! /bin/sh -# Filename: ctools-setup(.in) +# Filename: ctools-setup(.in) # Description: Writes an initialization script for ctools software # which is custom fit to the user and the particular # software installation. Note that this script is @@ -98,12 +97,10 @@ fi # # Set LD_LIBRARY_PATH # =================== -if [ "x$LD_LIBRARY_PATH" = x ]; then - LD_LIBRARY_PATH="$ctools_lib" +if [ -z "${LD_LIBRARY_PATH}" ]; then + LD_LIBRARY_PATH=$ctools_lib else - LD_LIBRARY_PATH=`echo ":$LD_LIBRARY_PATH:" | \ - sed "s%:$ctools_lib:%:%g" | sed "s%::*$%%"` - LD_LIBRARY_PATH="$ctools_lib$LD_LIBRARY_PATH" + LD_LIBRARY_PATH=$ctools_lib:$LD_LIBRARY_PATH fi # @@ -111,20 +108,17 @@ fi # ================================= case $uname_system in Darwin*) - if [ "x$DYLD_LIBRARY_PATH" = x ]; then - DYLD_LIBRARY_PATH="$ctools_lib" + if [ -z "${DYLD_LIBRARY_PATH}" ]; then + DYLD_LIBRARY_PATH=$ctools_lib else - DYLD_LIBRARY_PATH=`echo ":$DYLD_LIBRARY_PATH:" | \ - sed "s%:$ctools_lib:%:%g" | sed "s%::*$%%"` - DYLD_LIBRARY_PATH="$ctools_lib$DYLD_LIBRARY_PATH" + DYLD_LIBRARY_PATH=$ctools_lib:$DYLD_LIBRARY_PATH fi ;; CYGWIN*) - if [ "x$PATH" = x ]; then - PATH="$ctools_lib" + if [ -z "${PATH}" ]; then + PATH=$ctools_lib else - PATH=`echo ":$PATH:" | sed "s%:$ctools_lib:%:%g" | sed "s%::*$%%"` - PATH="$ctools_lib$PATH" + PATH=$ctools_lib:$PATH fi ;; esac @@ -132,41 +126,28 @@ esac # # Set PYTHONPATH # ============== -if [ "x$PYTHONPATH" = x ]; then - PYTHONPATH="$python_dir" +if [ -z "${PYTHONPATH}" ]; then + PYTHONPATH=$python_dir:$python_exec_dir else - PYTHONPATH=`echo ":$PYTHONPATH:" | \ - sed "s%:$python_dir:%:%g" | sed "s%::*$%%"` - PYTHONPATH="$python_dir$PYTHONPATH" -fi -if [ "x$PYTHONPATH" = x ]; then - PYTHONPATH="$python_exec_dir" -else - PYTHONPATH=`echo ":$PYTHONPATH:" | \ - sed "s%:$python_exec_dir:%:%g" | sed "s%::*$%%"` - PYTHONPATH="$python_exec_dir$PYTHONPATH" + PYTHONPATH=$python_dir:$python_exec_dir:$PYTHONPATH fi # # Set PKG_CONFIG_PATH # =================== -if [ "x$PKG_CONFIG_PATH" = x ]; then - PKG_CONFIG_PATH="$pkgconfig_dir" +if [ -z "${PKG_CONFIG_PATH}" ]; then + PKG_CONFIG_PATH=$pkgconfig_dir else - PKG_CONFIG_PATH=`echo ":$PKG_CONFIG_PATH:" | \ - sed "s%:$pkgconfig_dir:%:%g" | sed "s%::*$%%"` - PKG_CONFIG_PATH="$pkgconfig_dir$PKG_CONFIG_PATH" + PKG_CONFIG_PATH=$pkgconfig_dir:$PKG_CONFIG_PATH fi # # Set PATH # ======== -if [ "x$PATH" = x ]; then - PATH="$ctools_bin" +if [ -z "${PATH}" ]; then + PATH=$ctools_bin else - PATH=`echo ":$PATH:" | \ - sed "s%:$ctools_bin:%:%g" | sed "s%::*$%%"` - PATH="$ctools_bin$PATH" + PATH=$ctools_bin:$PATH fi # @@ -188,8 +169,8 @@ fi # # Set CALDB (if not yet set) # ========================== -if [ "x$CALDB" = x ]; then - CALDB="$caldb_dir" +if [ -z "${CALDB}" ]; then + CALDB=$caldb_dir fi # -- libgit2 0.21.4