aboutsummaryrefslogtreecommitdiff
path: root/pbuilder-checkparams
diff options
context:
space:
mode:
authorMattia Rizzolo <mattia@mapreri.org>2015-11-15 10:38:39 +0000
committerMattia Rizzolo <mattia@mapreri.org>2015-11-15 11:15:21 +0000
commitbcae9f4ab8743c9d6886944108fe133816cb486d (patch)
tree73702cee8af3070d7c046d31c99ff3d8dfe9b6cd /pbuilder-checkparams
parente2420f46582fb7761d04ed86c2201dd79a857e51 (diff)
downloadpbuilder-bcae9f4ab8743c9d6886944108fe133816cb486d.tar
pbuilder-bcae9f4ab8743c9d6886944108fe133816cb486d.tar.gz
make the output level configurable through LOGLEVEL (--loglevel)
valid values are D/I/W/E Closes: #490184
Diffstat (limited to 'pbuilder-checkparams')
-rwxr-xr-xpbuilder-checkparams14
1 files changed, 14 insertions, 0 deletions
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"