X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=.profile.d%2Fgnu.sh;h=63d4ba1d8760515903b7e341a7465e15ddf84fbb;hb=942a43e2e16198361bee17df0077435a5064a2ed;hp=62a52ef5d984946a84f18469c533432b9791d85d;hpb=4108a92c90fdef07f556ac73476fba6441822992;p=home.git 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