From 80eca94c8eec7dfeda02eff437309c4e20931afd Mon Sep 17 00:00:00 2001 From: Johannes Löthberg Date: Wed, 2 Jul 2014 17:04:13 +0200 Subject: makepkg: Respect XDG_CONFIG_HOME MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for following the XDG Base Directory Specification when reading the user-specific configuration file. If no $XDG_CONFIG_HOME/pacman/makepkg.conf file exists we fall back to sourcing $HOME/.makepkg.conf Signed-off-by: Johannes Löthberg [Allan] Note XDG_CONFIG_HOME takes priority. Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 779ebcbf..d0c5a6b1 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -2789,8 +2789,13 @@ fi # Source user-specific makepkg.conf overrides, but only if no override config # file was specified -if [[ $MAKEPKG_CONF = "$confdir/makepkg.conf" && -r ~/.makepkg.conf ]]; then - source_safe ~/.makepkg.conf +XDG_PACMAN_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/pacman" +if [[ "$MAKEPKG_CONF" = "$confdir/makepkg.conf" ]]; then + if [[ -r "$XDG_PACMAN_DIR/makepkg.conf" ]]; then + source_safe "$XDG_PACMAN_DIR/makepkg.conf" + elif [[ -r "$HOME/.makepkg.conf" ]]; then + source_safe "$HOME/.makepkg.conf" + fi fi # set pacman command if not already defined -- cgit v1.2.3-70-g09d2