From d6d7e860a6649d5020a503b40f1453628b273cbb Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 1 Jul 2014 10:40:33 +0200 Subject: [PATCH] xbps-src: if etc/conf does not exist fallback to ~/.xbps-src.conf. --- README.md | 4 ++-- xbps-src | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 19a40148221..70e39685172 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/xbps-src b/xbps-src index c406c63ad4e..44758baeb0d 100755 --- a/xbps-src +++ b/xbps-src @@ -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