From bcae9f4ab8743c9d6886944108fe133816cb486d Mon Sep 17 00:00:00 2001 From: Mattia Rizzolo Date: Sun, 15 Nov 2015 10:38:39 +0000 Subject: make the output level configurable through LOGLEVEL (--loglevel) valid values are D/I/W/E Closes: #490184 --- pbuilder-checkparams | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'pbuilder-checkparams') diff --git a/pbuilder-checkparams b/pbuilder-checkparams index 51aafab..74666ca 100755 --- a/pbuilder-checkparams +++ b/pbuilder-checkparams @@ -132,6 +132,10 @@ while [ -n "$1" ]; do REMOVEPACKAGES="$2"; shift; shift; ;; + --loglevel) + LOGLEVEL="$2" + shift; shift; + ;; --configfile) if [ ! -f "$2" ]; then log.e "Config file $2 does not exist" @@ -295,6 +299,16 @@ if [ -z "${CHROOTEXEC}" ]; then CHROOTEXEC="chroot $BUILDPLACE " fi +# sanity check of LOGLEVEL +case "$LOGLEVEL" in + D|I|W|E) ;; + *) # use log() instead of log.e() to override the buggy LOGLEVEL + log "E: A non-valid LOGLEVEL has been specified: '${LOGLEVEL}'." + log "E: Valid values are D, I, W, E" + exit 1 + ;; +esac + # handle 'experimental' specially. -- required for raw pbuilder (create/update) only. if [ "$DISTRIBUTION" = "experimental" ]; then DISTRIBUTION="sid" -- cgit v1.2.3