From ef637a9553838a3203387dc3340c5eb16ab5a6a4 Mon Sep 17 00:00:00 2001 From: John Date: Fri, 8 May 2020 16:09:48 +0200 Subject: [PATCH] xbps-src: allow loading xbp-src.conf from XDG compliant dirs --- README.md | 2 +- xbps-src | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 752fb3d4fdc..3dffd2b4511 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,7 @@ If you don't want to waste your time building everything from scratch probably i The `etc/defaults.conf` file contains the possible settings that can be overridden through the `etc/conf` configuration file for the `xbps-src` utility; if that file -does not exist, will try to read configuration settings from `~/.xbps-src.conf`. +does not exist, will try to read configuration settings from `$XDG_CONFIG_HOME/xbps-src.conf`, `~/.config/xbps-src.conf`, `~/.xbps-src.conf`. If you want to customize default `CFLAGS`, `CXXFLAGS` and `LDFLAGS`, don't override those defined in `etc/defaults.conf`, set them on `etc/conf` instead i.e: diff --git a/xbps-src b/xbps-src index 68765b6c248..888bc3c474a 100755 --- a/xbps-src +++ b/xbps-src @@ -428,6 +428,8 @@ else elif [ -s $XBPS_DISTDIR/etc/conf ]; then # ... otherwise read generic user configuration... readonly XBPS_CONFIG_FILE=$XBPS_DISTDIR/etc/conf + elif [ -s ${XDG_CONFIG_HOME:-$HOME/.config}/xbps-src.conf ]; then + readonly XBPS_CONFIG_FILE=${XDG_CONFIG_HOME:-$HOME/.config}/xbps-src.conf elif [ -s $HOME/.xbps-src.conf ]; then # ... fallback to ~/.xbps-src.conf otherwise. readonly XBPS_CONFIG_FILE=$HOME/.xbps-src.conf