summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libretools.conf46
1 files changed, 30 insertions, 16 deletions
diff --git a/src/libretools.conf b/src/libretools.conf
index d310776..cc8a8f1 100644
--- a/src/libretools.conf
+++ b/src/libretools.conf
@@ -84,22 +84,36 @@ TORUPATH=/var/lib/libretools/toru
#SIGEXT=".sig"
#SIGID="0xYOURID"
-# Checks if vars aren't empty
-
+################################################################################
+# This probably shouldn't be in a .conf file... #
+################################################################################
+
+if [[ -z $XDG_CONFIG_HOME ]]; then
+ if [[ -n $SUDO_USER ]]; then
+ SUDO_HOME="$(eval echo ~$SUDO_USER)"
+ export XDG_CONFIG_HOME="${SUDO_HOME}/.config"
+ unset SUDO_HOME
+ else
+ export XDG_CONFIG_HOME="${HOME}/.config"
+ fi
+fi
+if [[ -e "$XDG_CONFIG_HOME/libretools/libretools.conf" ]]; then
+ . "$XDG_CONFIG_HOME/libretools/libretools.conf"
+fi
+
+ret=0
for VAR in CHROOTDIR CHROOT CACHEDIR PARABOLAHOST LIBREDESTDIR \
- BLACKLIST WORKDIR REPOS ARCHES ABSLIBREGIT \
- COMMITCMD DIFFTOOL FULLBUILDCMD; do
-
- ret=0
- [[ -z ${!VAR} ]] && {
- echo "Configure $VAR var in /etc/libretools.conf"
- ret=1
- }
- [ $ret -ne 0 ] && exit 1
-done
+ BLACKLIST WORKDIR REPOS ARCHES ABSLIBREGIT \
+ COMMITCMD DIFFTOOL FULLBUILDCMD; do
-source /usr/bin/libremessages
+ if [[ -z ${!VAR} ]]; then
+ echo "Configure $VAR var in /etc/libretools.conf"
+ ret=1
+ fi
+done
+if [[ $ret != 0 ]]; then
+ exit 1
+fi
+unset ret
-## These are architecture specific files.
-## Uncomment them if you installed libretools-mips64el
-# source /etc/libretools.d/mips64el.conf
+. /usr/bin/libremessages