From: Mike Frysinger Date: Fri, 13 Jan 2012 20:25:40 +0000 (-0500) Subject: setup more gnu vars X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;ds=sidebyside;h=794ebd996a5f193d2597026598e9d5b852b604a3;p=home.git setup more gnu vars --- diff --git a/.profile.d/gnu.sh b/.profile.d/gnu.sh index 62a52ef..63d4ba1 100644 --- a/.profile.d/gnu.sh +++ b/.profile.d/gnu.sh @@ -1,7 +1,9 @@ -GNULIB_SRCDIR=/usr/local/src/gnu/gnulib -[[ ! -d ${GNULIB_SRCDIR} ]] && GNULIB_SRCDIR=/usr/local/src/gnulib -if [[ -d ${GNULIB_SRCDIR} ]] ; then - export GNULIB_SRCDIR -else - unset GNULIB_SRCDIR -fi +gnu_var_setup() { + local var="${1^^}_SRCDIR" + local path="/usr/local/src/gnu/$1" + [[ ! -d ${path} ]] && path="/usr/local/src/$1" + [[ -d ${path} ]] && eval export ${var}=\""${path}"\" +} +gnu_var_setup gnulib +gnu_var_setup paxutils +unset gnu_var_setup