xbps-src: if etc/conf does not exist fallback to ~/.xbps-src.conf.

This commit is contained in:
Juan RP 2014-07-01 10:40:33 +02:00
parent 871d2fa873
commit d6d7e860a6
2 changed files with 9 additions and 6 deletions

View File

@ -20,8 +20,8 @@ to see all available targets/options and start building any available package
in the `srcpkgs` directory.
The `etc/defaults.conf` file contains the possible settings that can be overrided
through the `etc/conf` configuration file for the `xbps-src` utility; optionally if
`~/.xbps-src.conf` exists it's also read after `etc/conf`.
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`.
If you want to customize default `CFLAGS`, `CXXFLAGS` and `LDFLAGS`, don't override
those defined in `etc/defaults.conf`, append to them instead via `etc/conf` i.e:

View File

@ -369,10 +369,13 @@ else
if [ -f $XBPS_DISTDIR/etc/defaults.conf ]; then
. $XBPS_DISTDIR/etc/defaults.conf
fi
readonly XBPS_CONFIG_FILE=$XBPS_DISTDIR/etc/conf
# If ~/.xbps-src.conf exists, use it too.
if [ -s $HOME/.xbps-src.conf ]; then
. $HOME/.xbps-src.conf
if [ -s $XBPS_DISTDIR/etc/conf ]; then
# Read user configuration first...
readonly XBPS_CONFIG_FILE=$XBPS_DISTDIR/etc/conf
elif [ -s $HOME/.xbps-src.conf ]; then
# ... fallback to ~/.xbps-src.conf otherwise.
readonly XBPS_CONFIG_FILE=$HOME/.xbps-src.conf
. $XBPS_CONFIG_FILE
fi
fi