Commit 0f4e9d19b9f9b78c03c5aa06d753a1eb6a8834f7

Authored by Jürgen Knödlseder
2 parents 34aaf10c ce3f41d4

Merge branch '2420-manpath' into integration

# Conflicts:
#	ChangeLog
ChangeLog
... ... @@ -8,11 +8,12 @@
8 8 Accelerate IRF and RING background methods in ctskymap (#2309)
9 9  
10 10  
11   -2018-02-16
  11 +2018-03-26
12 12  
13 13 * Bug fix version 1.5.1 released
14 14 ================================
15 15  
  16 + Fix MANPATH for Mac OS X systems (#2420)
16 17 Take energy dispersion in csresspec modelling into account (#2341)
17 18 Enable using csphagen for HESS, VERITAS and MAGIC observations (#2307)
18 19  
... ...
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 #
... ...