Commit ce3f41d42c1a5ec681011d9559d25aa175190818

Authored by Jürgen Knödlseder
1 parent 679f07ac

Fix MANPATH for Mac OS X systems (#2420)

ChangeLog
1   -2018-02-16
  1 +2018-03-26
2 2  
3 3 * Bug fix version 1.5.1 released
4 4 ================================
5 5  
  6 + Fix MANPATH for Mac OS X systems (#2420)
6 7 Take energy dispersion in csresspec modelling into account (#2341)
7 8 Enable using csphagen for HESS, VERITAS and MAGIC observations (#2307)
8 9  
... ...
doc/source/admin/release_history/1.5.1.rst
... ... @@ -10,6 +10,8 @@ ctools 1.5.1 is a bug fix release for ctools release 1.5.
10 10  
11 11 The following bugs were fixed:
12 12  
  13 +* [`2420 <https://cta-redmine.irap.omp.eu/issues/2420>`_] -
  14 + Fix ``MANPATH`` for Mac OS X systems
13 15 * [`2341 <https://cta-redmine.irap.omp.eu/issues/2341>`_] -
14 16 Take energy dispersion in :ref:`csresspec` modelling into account
15 17  
... ...
src/ctools-setup.in
... ... @@ -172,13 +172,17 @@ fi
172 172 #
173 173 # Set MANPATH
174 174 # ==============
175   -if [ "x$MANPATH" = x ]; then
176   - manpath=${manpath:-}
177   - MANPATH="$man_dir:${manpath}"
  175 +if [ -z "${MANPATH}" ]; then
  176 + if `which manpath > /dev/null 2>&1` ; then
  177 + default_manpath=`manpath`
  178 + else
  179 + default_manpath=`man -w 2> /dev/null`
  180 + fi
  181 +fi
  182 +if [ -z "${MANPATH}" ]; then
  183 + MANPATH=$man_dir:${default_manpath}; export MANPATH
178 184 else
179   - MANPATH=`echo ":$MANPATH:" | \
180   - sed "s%:$man_dir:%:%g" | sed "s%::*$%%"`
181   - MANPATH="$man_dir$MANPATH"
  185 + MANPATH=$man_dir:$MANPATH; export MANPATH
182 186 fi
183 187  
184 188 #
... ...