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

@ -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