On 17/4/19 3:17 am, Eli Schwartz wrote:
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org> ---
Comments from v1 indicate this will be useful for (e.g.) devtools to read a makepkg.conf. But devtools uses a custom makepkg.conf plus info from a users ~/.makepkg.conf. This patch will allow reading the custom makepkg.conf, but as it is not the system makepkg.conf it would then not parse the ~/. one. So does this patch achieve its purpose?
v2: fix a missing dependency, rebase on top of https://patchwork.archlinux.org/patch/1074/ because util.sh had a missing dependency
<snip>
merge_arch_attrs() { local attr supported_attrs=( provides conflicts depends replaces optdepends @@ -1113,25 +1104,7 @@ restore_envvars=$(declare -p PKGDEST SRCDEST SRCPKGDEST LOGDEST BUILDDIR PKGEXT # default config is makepkg.conf MAKEPKG_CONF=${MAKEPKG_CONF:-$confdir/makepkg.conf}
This is not needed any more. The logic is handled in the source_makepkg_conf() function. The MAKEPKG_CONF variable is not used elsewhere.
-# Source the config file; fail if it is not found -if [[ -r $MAKEPKG_CONF ]]; then - source_safe "$MAKEPKG_CONF" -else - error "$(gettext "%s not found.")" "$MAKEPKG_CONF" - plain "$(gettext "Aborting...")" - exit $E_CONFIG_ERROR -fi - -# Source user-specific makepkg.conf overrides, but only if no override config -# file was specified -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 +source_makepkg_config "$MAKEPKG_CONF"
eval "$restore_envvars"