[pbuilder] 01/01: loadconfig: be more honest about why it's not possible to load a conf file, instead of just saying "it doesn't exist"

Mattia Rizzolo mattia at debian.org
Mon Nov 28 01:30:41 UTC 2016


This is an automated email from the git hooks/post-receive script.

mattia pushed a commit to branch master
in repository pbuilder.

commit d47fcaafa159ebf0cf12c0ebc535ab2b97e4bd57
Author: Mattia Rizzolo <mattia at debian.org>
Date:   Mon Nov 21 23:37:23 2016 +0100

    loadconfig: be more honest about why it's not possible to load a conf file, instead of just saying "it doesn't exist"
    
    Also, fail in case the file exists, but can't be loaded.
    
    Closes: #844560
---
 pbuilder-loadconfig | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pbuilder-loadconfig b/pbuilder-loadconfig
index 6f03c96..e088857 100644
--- a/pbuilder-loadconfig
+++ b/pbuilder-loadconfig
@@ -24,11 +24,11 @@ for RCFILE in \
     "$PBUILDER_PKGDATADIR"/pbuilderrc \
     "$PBUILDER_SYSCONFDIR"/pbuilderrc \
     "$HOME"/.pbuilderrc; do
-    if [ -f "$RCFILE" ]; then 
-	. "$RCFILE"
+    # log() is not available
+    if [ -e "$RCFILE" ]; then
+        . "$RCFILE" || ( echo "E: $RCFILE could not be loaded" >&2 ; exit 1 )
     else
-	# log() is not available
-	echo "W: $RCFILE does not exist" >&2
+        echo "W: $RCFILE does not exist" >&2
     fi
     # deprecated in v0.216
     if [ -n "$PKGNAME_LOGFILE_EXTENTION" ] ; then

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pbuilder/pbuilder.git



More information about the Pbuilder-maint mailing list