[pacman-dev] [PATCH v2] makepkg: Respect XDG_CONFIG_HOME

Luke Shumaker lukeshu at sbcglobal.net
Sat Jul 5 18:33:04 EDT 2014


At Wed,  2 Jul 2014 17:04:13 +0200,
Johannes Löthberg wrote:
> If no $XDG_CONFIG_HOME/pacman/makepkg.conf file exists we fall back to
> sourcing $HOME/.makepkg.conf
>  
>  # 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

Is "falling back" the right thing?  My gut sort of tells me that if
they both exist, they should both be loaded, but that's just me.

Happy hacking,
~ Luke Shumaker


More information about the pacman-dev mailing list