Commit fb2451ec1237cf7029b31a012676424d6d23c367

Authored by Jürgen Knödlseder
1 parent 147c3f16

Fix MANPATH for Mac OS X systems (#2420)

ChangeLog
1   -2018-03-19
  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 Add kludge to handle noisy CTA 2D energy dispersion (#2342, #2403).
7 8 Prevent unintentional deallocation of arguments (#2340).
8 9 Correct sky map smoothing.
... ...
doc/source/admin/release_history/1.5.1.rst
... ... @@ -10,6 +10,8 @@ GammaLib 1.5.1 is a bug fix release for GammaLib 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 * [`2403 <https://cta-redmine.irap.omp.eu/issues/2403>`_] -
14 16 Refine kludge to handle noisy CTA 2D energy dispersion
15 17 * [`2342 <https://cta-redmine.irap.omp.eu/issues/2342>`_] -
... ...
src/gammalib-setup.in
... ... @@ -170,13 +170,17 @@ fi
170 170 #
171 171 # Set MANPATH
172 172 # ===========
173   -if [ "x$MANPATH" = x ]; then
174   - manpath=${manpath:-}
175   - MANPATH="$man_dir:${manpath}"
  173 +if [ -z "${MANPATH}" ]; then
  174 + if `which manpath > /dev/null 2>&1` ; then
  175 + default_manpath=`manpath`
  176 + else
  177 + default_manpath=`man -w 2> /dev/null`
  178 + fi
  179 +fi
  180 +if [ -z "${MANPATH}" ]; then
  181 + MANPATH=$man_dir:${default_manpath}; export MANPATH
176 182 else
177   - MANPATH=`echo ":$MANPATH:" | \
178   - sed "s%:$man_dir:%:%g" | sed "s%::*$%%"`
179   - MANPATH="$man_dir$MANPATH"
  183 + MANPATH=$man_dir:$MANPATH; export MANPATH
180 184 fi
181 185  
182 186 #
... ...