summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/conf.sh8
-rw-r--r--src/libretools.conf31
2 files changed, 13 insertions, 26 deletions
diff --git a/src/lib/conf.sh b/src/lib/conf.sh
index 8abbc5a..b11495d 100644
--- a/src/lib/conf.sh
+++ b/src/lib/conf.sh
@@ -92,9 +92,15 @@ set_conf_makepkg() {
# libretools configuration #####################################################
+check_conf_libretools() {
+ check_vars libretools.conf \
+ PARABOLAHOST LIBREDESTDIR BLACKLIST WORKDIR REPOS ARCHES \
+ ABSLIBREGIT COMMITCMD DIFFTOOL FULLBUILDCMD SIGEXT SIGID
+}
+
load_conf_libretools() {
load_files libretools
- # TODO: checks
+ check_conf_libretools
}
load_conf_libretools_chroot() {
diff --git a/src/libretools.conf b/src/libretools.conf
index f3e567a..b1a6e6e 100644
--- a/src/libretools.conf
+++ b/src/libretools.conf
@@ -91,34 +91,15 @@ HOOKPRERELEASE="ssh -fN parabola"
TORUPATH=/var/lib/libretools/toru
################################################################################
-# This probably shouldn't be in a .conf file... #
+# Stub for old programs; wouldn't normally be in a .conf file #
################################################################################
if [[ -z ${INCLUDE_CONF_SH:-} ]]; then
-
-LIBREUSER="${SUDO_USER:-$USER}"
-LIBREHOME="$(eval echo ~$LIBREUSER)"
-if [[ -z ${XDG_CONFIG_HOME:-} ]]; then
- export XDG_CONFIG_HOME="${LIBREHOME}/.config"
-fi
-if [[ -e "$XDG_CONFIG_HOME/libretools/libretools.conf" ]]; then
- . "$XDG_CONFIG_HOME/libretools/libretools.conf"
-fi
-
-ret=0
-for VAR in PARABOLAHOST LIBREDESTDIR \
- BLACKLIST WORKDIR REPOS ARCHES ABSLIBREGIT \
- COMMITCMD DIFFTOOL FULLBUILDCMD SIGEXT SIGID; do
- if [[ -z ${!VAR} ]]; then
- echo "Configure $VAR var in /etc/libretools.conf"
- ret=1
+ . /usr/share/libretools/conf.sh
+ if [[ -e "$XDG_CONFIG_HOME/libretools/libretools.conf" ]]; then
+ . "$XDG_CONFIG_HOME/libretools/libretools.conf"
fi
-done
-if [[ $ret != 0 ]]; then
- exit 1
-fi
-unset ret
-
-. /usr/bin/libremessages
+ check_conf_libretools || exit $?
+ . /usr/bin/libremessages
fi