From 794ebd996a5f193d2597026598e9d5b852b604a3 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 13 Jan 2012 15:25:40 -0500 Subject: [PATCH] setup more gnu vars --- .profile.d/gnu.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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 -- 2.39.2