]> git.wh0rd.org - home.git/blobdiff - .profile.d/gnu.sh
cros-board: update
[home.git] / .profile.d / gnu.sh
index 62a52ef5d984946a84f18469c533432b9791d85d..63d4ba1d8760515903b7e341a7465e15ddf84fbb 100644 (file)
@@ -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