#!/bin/sh
#set -e

. $KUMATUXBIN/kumatux.org-vars

KUMATUX_MANPATH_ESCAPED=`$KUMATUXBIN/kumatux.org-sed-escape $KUMATUX_MANPATH`
if [ "$KUMATUX_MANPATH_ESCAPED" ]
then
    SYSTEM_MANPATH=`echo $MANPATH | sed "s/$KUMATUX_MANPATH_ESCAPED://" | sed "s/$KUMATUX_MANPATH_ESCAPED//"`
else
    SYSTEM_MANPATH=$MANPATH
fi

export KUMATUX_MANPATH=`cat $KUMATUXETC/$KUMATUXETCMAN/*.conf 2>/dev/null`/usr/man
if [ "$SYSTEM_MANPATH" ]
then
    export MANPATH=$KUMATUX_MANPATH:$SYSTEM_MANPATH
else
    export MANPATH=$KUMATUX_MANPATH
fi
