summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-10-01 16:50:35 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-10-01 16:50:35 -0400
commit42ed1183c123e9afb7fddadbbc4e62d89f82b63d (patch)
treecb0ff8ce018ac2a794fb9ca5063f99dd01c19c24 /src/lib
parent8bb6a75193445d387bd64ffb4db144663b68bd7a (diff)
conf.sh: make sysconfdir overridable at runtime, use this for testingv20141001
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/conf.sh.in13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/conf.sh.in b/src/lib/conf.sh.in
index fa66016..6a2a3b0 100644
--- a/src/lib/conf.sh.in
+++ b/src/lib/conf.sh.in
@@ -38,29 +38,30 @@ fi
# Later files should take precedence over earlier files.
list_files() {
local slug=$1
+ local sysconfdir=${_librelib_conf_sh_sysconfdir:-@sysconfdir@}
case $slug in
abs)
- echo @sysconfdir@/$slug.conf
+ echo "${sysconfdir}/$slug.conf"
echo "$LIBREHOME/.$slug.conf"
;;
makepkg)
- if [[ ${MAKEPKG_CONF:-} != @sysconfdir@/$slug.conf && -r ${MAKEPKG_CONF:-} ]]; then
+ if [[ ${MAKEPKG_CONF:-} != ${sysconfdir}/$slug.conf && -r ${MAKEPKG_CONF:-} ]]; then
echo "$MAKEPKG_CONF"
else
- echo @sysconfdir@/$slug.conf
+ echo "${sysconfdir}/$slug.conf"
echo "$LIBREHOME/.$slug.conf"
fi
;;
xbs*)
- echo @sysconfdir@/xbs/$slug.conf
+ echo "${sysconfdir}/xbs/$slug.conf"
echo "$XDG_CONFIG_HOME/xbs/$slug.conf"
;;
libretools)
- echo @sysconfdir@/$slug.conf
+ echo "${sysconfdir}/$slug.conf"
echo "$XDG_CONFIG_HOME/libretools/$slug.conf"
;;
*)
- echo @sysconfdir@/libretools.d/$slug.conf
+ echo "${sysconfdir}/libretools.d/$slug.conf"
echo "$XDG_CONFIG_HOME/libretools/$slug.conf"
;;
esac