hi, I updated the patch for the latest git.
I hope you may include it.... a.
>From d5a9d085312ac774b20ce2ba544acf8aaeea3021 Mon Sep 17 00:00:00 2001 From: Andrea Mennucc <mennu...@debian.org> Date: Thu, 5 Apr 2012 09:58:58 +0200 Subject: [PATCH 3/3] add --quiet --verbose options --- pbuilder-checkparams | 20 ++++++++++++++++++++ pbuilder-createbuildenv | 6 +++--- pbuilder-modules | 10 ++++++++-- pbuilder-updatebuildenv | 8 ++++---- pbuilderrc | 10 ++++++++++ pdebuild-checkparams | 20 ++++++++++++++++++++ pdebuild-internal | 2 +- 7 files changed, 66 insertions(+), 10 deletions(-) diff --git a/pbuilder-checkparams b/pbuilder-checkparams index 3cdc48e..820cd56 100755 --- a/pbuilder-checkparams +++ b/pbuilder-checkparams @@ -260,6 +260,26 @@ while [ -n "$1" ]; do TWICE="yes" shift; ;; + --quiet) + if test ${VERBOSE:-2} = 2 ; then + VERBOSE=1 + APTQUIET="-q" + else + VERBOSE=0 + APTQUIET="-q -q" + fi + shift; + ;; + --verbose) + if test ${VERBOSE:-0} = 0 ; then + VERBOSE=1 + APTQUIET="-q" + else + VERBOSE=2 + APTQUIET="" + fi + shift; + ;; --) # end of processing for this shift; break; diff --git a/pbuilder-createbuildenv b/pbuilder-createbuildenv index 8362b1c..8974e03 100755 --- a/pbuilder-createbuildenv +++ b/pbuilder-createbuildenv @@ -95,7 +95,7 @@ log "I: Refreshing the base.tgz " log "I: upgrading packages" mountproc $TRAP umountproc_cleanbuildplace_trap exit sighup -$CHROOTEXEC /usr/bin/apt-get -q update +$CHROOTEXEC /usr/bin/apt-get $APTQUIET update case "`readlink -e "$PBUILDERSATISFYDEPENDSCMD"`" in *-aptitude) @@ -120,8 +120,8 @@ if [ -n "$REMOVEPACKAGES" ]; then $CHROOTEXEC /usr/bin/dpkg --purge $REMOVEPACKAGES fi recover_aptcache -$CHROOTEXEC /usr/bin/apt-get -q -y "${APTGETOPT[@]}" "${FORCE_CONFNEW[@]}" dist-upgrade -$CHROOTEXEC /usr/bin/apt-get -q -y "${APTGETOPT[@]}" install \ +$CHROOTEXEC /usr/bin/apt-get $APTQUIET -y "${APTGETOPT[@]}" "${FORCE_CONFNEW[@]}" dist-upgrade +$CHROOTEXEC /usr/bin/apt-get $APTQUIET -y "${APTGETOPT[@]}" install \ build-essential \ dpkg-dev \ $EXTRAPACKAGES diff --git a/pbuilder-modules b/pbuilder-modules index 5c935eb..bad5479 100644 --- a/pbuilder-modules +++ b/pbuilder-modules @@ -74,6 +74,8 @@ pbuilder-options: --bindmounts [bind-mount-point] --debug --twice + --verbose + --quiet --autocleanaptcache --compressprog [program] --debootstrapopts [debootstrap options] @@ -103,10 +105,14 @@ function log() { echo "$*" >&2 ;; "W: "*) - echo "$*" >&2 + if test ${VERBOSE:-2} -ge 1 ; then + echo "$*" >&2 + fi ;; "I: "*) - echo "$*" + if test ${VERBOSE:-2} -ge 2 ; then + echo "$*" + fi ;; *) echo "malformed log message: $*" diff --git a/pbuilder-updatebuildenv b/pbuilder-updatebuildenv index e673592..3f27442 100755 --- a/pbuilder-updatebuildenv +++ b/pbuilder-updatebuildenv @@ -39,7 +39,7 @@ $TRAP umountproc_cleanbuildplace_trap exit sighup loadhooks log "I: Refreshing the base.tgz " log "I: upgrading packages" -$CHROOTEXEC /usr/bin/apt-get -q update +$CHROOTEXEC /usr/bin/apt-get $APTQUIET update case "`readlink -e "$PBUILDERSATISFYDEPENDSCMD"`" in *-aptitude) @@ -66,12 +66,12 @@ fi recover_aptcache $TRAP saveaptcache_umountproc_cleanbuildplace_trap exit sighup -$CHROOTEXEC /usr/bin/apt-get -q -y "${APTGETOPT[@]}" "${FORCE_CONFNEW[@]}" dist-upgrade +$CHROOTEXEC /usr/bin/apt-get $APTQUIET -y "${APTGETOPT[@]}" "${FORCE_CONFNEW[@]}" dist-upgrade # autoremove: Ignore error in case of etch because apt in etch doesn't # support autoremove. TODO: Do not ignore error when etch is no longer # supported. -$CHROOTEXEC /usr/bin/apt-get -q -y "${APTGETOPT[@]}" autoremove || true -$CHROOTEXEC /usr/bin/apt-get -q -y "${APTGETOPT[@]}" install \ +$CHROOTEXEC /usr/bin/apt-get $APTQUIET -y "${APTGETOPT[@]}" autoremove || true +$CHROOTEXEC /usr/bin/apt-get $APTQUIET -y "${APTGETOPT[@]}" install \ build-essential \ dpkg-dev \ $EXTRAPACKAGES diff --git a/pbuilderrc b/pbuilderrc index 691e46d..2297dcc 100644 --- a/pbuilderrc +++ b/pbuilderrc @@ -117,3 +117,13 @@ AUTOCLEANAPTCACHE="" #default COMPRESSPROG COMPRESSPROG="gzip" + +# default verbosity, it is changed by --quiet and --verbose +# possible values are +# 2 -> output I: information, W: warning and E: error messages +# 1 -> output W: warning and E: error messages +# 0 -> output only E: error messages +VERBOSE=2 + +# default APT quieteness, it is changed by --quiet and --verbose +APTQUIET="-q" diff --git a/pdebuild-checkparams b/pdebuild-checkparams index b6ba0ed..1d4bb46 100644 --- a/pdebuild-checkparams +++ b/pdebuild-checkparams @@ -102,6 +102,26 @@ while [ -n "$1" ]; do --help) showhelp ;; + --quiet) + if test ${VERBOSE:-2} = 2 ; then + VERBOSE=1 + APTQUIET="-q" + else + VERBOSE=0 + APTQUIET="-q -q" + fi + shift; + ;; + --verbose) + if test ${VERBOSE:-0} = 0 ; then + VERBOSE=1 + APTQUIET="-q" + else + VERBOSE=2 + APTQUIET="" + fi + shift; + ;; --) # end of processing for this shift; break; diff --git a/pdebuild-internal b/pdebuild-internal index 0c4fb99..07de1c9 100644 --- a/pdebuild-internal +++ b/pdebuild-internal @@ -30,7 +30,7 @@ set -e # I am probably running as root; make sure I have pbuilder installed here. # passwd is needed as well because of useradd and groupadd calls. -apt-get install -q -y "${APTGETOPT[@]}" pbuilder passwd +apt-get install $APTQUIET -y "${APTGETOPT[@]}" pbuilder passwd # I'm not going to have the same LOGNAME as outside, I'm root. export LOGNAME=root -- 1.7.2.5