From 9c9e18ef32c0cf3fe33ed251d28c70651bb85f65 Mon Sep 17 00:00:00 2001 From: Andrew Fyfe Date: Mon, 2 Apr 2007 00:55:01 +0100 Subject: Tidy up usage of makepkg.conf Moved the following variables into /etc/makepkg.conf * BUILDSCRIPT * PKGEXT * DB_COMPRESSION * DB_CHECKSUMS Cleaned up sourcing of /etc/makepkg.conf in scripts and source ~/.makepkg.conf if it exists. Signed-off-by: Andrew Fyfe Signed-off-by: Dan McGee --- scripts/makepkg.in | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'scripts/makepkg.in') diff --git a/scripts/makepkg.in b/scripts/makepkg.in index 17a500bc..62a2a444 100755 --- a/scripts/makepkg.in +++ b/scripts/makepkg.in @@ -36,11 +36,16 @@ export TEXTDOMAINDIR myver='3.0.0' startdir=$(pwd) -BUILDSCRIPT="PKGBUILD" -PKGEXT="pkg.tar.gz" - -source "/etc/abs/abs.conf" -SRCROOT="$ABSROOT" +# Only use ABSROOT if we haven't been passed a SRCROOT on the command line. +if [ -z "$SRCROOT" ]; then + if [ -r /etc/abs/abs.conf ]; then + source /etc/abs/abs.conf + fi + if [ -r ~/.abs.conf ]; then + source ~/.abs.conf + fi + SRCROOT=$ABSROOT +fi # Options CLEANUP=0 @@ -418,16 +423,16 @@ ARGLIST=$@ _PKGDEST=${PKGDEST} _SRCDEST=${SRCDEST} -#Source makepkg.conf; fail if it is not found -if [ -f /etc/makepkg.conf ]; then +# Source makepkg.conf; fail if it is not found +if [ -r /etc/makepkg.conf ]; then source /etc/makepkg.conf else error "$(gettext "/etc/makepkg.conf not found. cannot continue")" - exit 1 + exit 1 # $E_CONFIG_ERROR # TODO: error codes fi -#Source user-specific makepkg.conf overrides -if [ -f ~/.makepkg.conf ]; then +# Source user-specific makepkg.conf overrides +if [ -r ~/.makepkg.conf ]; then source ~/.makepkg.conf fi -- cgit v1.2.3-54-g00ecf