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. in the `srcpkgs` directory.
The `etc/defaults.conf` file contains the possible settings that can be overrided 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 through the `etc/conf` configuration file for the `xbps-src` utility; if that file
`~/.xbps-src.conf` exists it's also read after `etc/conf`. 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 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: 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 if [ -f $XBPS_DISTDIR/etc/defaults.conf ]; then
. $XBPS_DISTDIR/etc/defaults.conf . $XBPS_DISTDIR/etc/defaults.conf
fi fi
readonly XBPS_CONFIG_FILE=$XBPS_DISTDIR/etc/conf if [ -s $XBPS_DISTDIR/etc/conf ]; then
# If ~/.xbps-src.conf exists, use it too. # Read user configuration first...
if [ -s $HOME/.xbps-src.conf ]; then readonly XBPS_CONFIG_FILE=$XBPS_DISTDIR/etc/conf
. $HOME/.xbps-src.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
fi fi