hi,

here is a patch for having a new option 'pbuilder --quiet '

is is not very tested, but it seems to work

a.
diff -ur pbuilder-0.199+nmu3/debian/changelog pbuilder-0.199+nmu3+quiet//debian/changelog
--- pbuilder-0.199+nmu3/debian/changelog	2011-04-09 01:36:25.000000000 +0200
+++ pbuilder-0.199+nmu3+quiet//debian/changelog	2011-04-13 14:59:50.000000000 +0200
@@ -1,3 +1,9 @@
+pbuilder (0.199+nmu3+quiet) unstable; urgency=low
+
+  * add --quiet and --verbose
+
+ -- A Mennucc1 <mennu...@debian.org>  Wed, 13 Apr 2011 14:45:47 +0200
+
 pbuilder (0.199+nmu3) unstable; urgency=low
 
   * Non-Maintainer Upload.
Solo in pbuilder-0.199+nmu3+quiet//debian: changelog~
Solo in pbuilder-0.199+nmu3+quiet//debian: changelog.orig
diff -ur pbuilder-0.199+nmu3/pbuilder-checkparams pbuilder-0.199+nmu3+quiet//pbuilder-checkparams
--- pbuilder-0.199+nmu3/pbuilder-checkparams	2010-01-03 03:38:09.000000000 +0100
+++ pbuilder-0.199+nmu3+quiet//pbuilder-checkparams	2011-04-13 14:59:17.000000000 +0200
@@ -246,6 +246,26 @@
 	    TWICE="yes"
 	    shift;
 	    ;;
+	--quiet)
+	    if test ${VERBOSE:-1} = 1 ; then
+		VERBOSE=0
+		APTQUIET="-q -q"
+	    else
+		VERBOSE=1
+		APTQUIET="-q"
+	    fi
+	    shift;
+	    ;;
+	--verbose)
+	    if test ${VERBOSE:-1} = 1 ; then
+		VERBOSE=2
+		APTQUIET=""
+	    else
+		VERBOSE=1
+		APTQUIET="-q"
+	    fi
+	    shift;
+	    ;;
 	--) # end of processing for this
 	    shift;
 	    break;
diff -ur pbuilder-0.199+nmu3/pbuilder-createbuildenv pbuilder-0.199+nmu3+quiet//pbuilder-createbuildenv
--- pbuilder-0.199+nmu3/pbuilder-createbuildenv	2010-07-05 15:09:18.000000000 +0200
+++ pbuilder-0.199+nmu3+quiet//pbuilder-createbuildenv	2011-04-13 14:59:17.000000000 +0200
@@ -85,7 +85,7 @@
 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)
@@ -110,8 +110,8 @@
     $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 build-essential dpkg-dev $EXTRAPACKAGES
+$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
 save_aptcache
 
 executehooks "E"
diff -ur pbuilder-0.199+nmu3/pbuilder-modules pbuilder-0.199+nmu3+quiet//pbuilder-modules
--- pbuilder-0.199+nmu3/pbuilder-modules	2011-04-09 01:36:25.000000000 +0200
+++ pbuilder-0.199+nmu3+quiet//pbuilder-modules	2011-04-13 14:59:17.000000000 +0200
@@ -74,6 +74,8 @@
  --bindmounts [bind-mount-point]
  --debug
  --twice
+ --verbose
+ --quiet
  --autocleanaptcache
  --debootstrapopts [debootstrap options]
  --save-after-login/--save-after-exec
@@ -102,10 +104,14 @@
 	    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 -ur pbuilder-0.199+nmu3/pbuilderrc pbuilder-0.199+nmu3+quiet//pbuilderrc
--- pbuilder-0.199+nmu3/pbuilderrc	2010-07-05 15:06:08.000000000 +0200
+++ pbuilder-0.199+nmu3+quiet//pbuilderrc	2011-04-13 14:59:17.000000000 +0200
@@ -99,3 +99,14 @@
 
 # default AUTOCLEANAPTCACHE
 AUTOCLEANAPTCACHE=""
+
+
+# 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 -ur pbuilder-0.199+nmu3/pbuilder-updatebuildenv pbuilder-0.199+nmu3+quiet//pbuilder-updatebuildenv
--- pbuilder-0.199+nmu3/pbuilder-updatebuildenv	2010-07-05 15:09:45.000000000 +0200
+++ pbuilder-0.199+nmu3+quiet//pbuilder-updatebuildenv	2011-04-13 14:59:17.000000000 +0200
@@ -37,7 +37,7 @@
 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)
@@ -64,12 +64,12 @@
 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 build-essential dpkg-dev $EXTRAPACKAGES
+$CHROOTEXEC /usr/bin/apt-get $APTQUIET -y "${APTGETOPT[@]}" autoremove || true
+$CHROOTEXEC /usr/bin/apt-get $APTQUIET -y "${APTGETOPT[@]}" install build-essential dpkg-dev $EXTRAPACKAGES
 save_aptcache
 
 # optionally auto-clean apt-cache
diff -ur pbuilder-0.199+nmu3/pdebuild-checkparams pbuilder-0.199+nmu3+quiet//pdebuild-checkparams
--- pbuilder-0.199+nmu3/pdebuild-checkparams	2010-01-03 03:38:09.000000000 +0100
+++ pbuilder-0.199+nmu3+quiet//pdebuild-checkparams	2011-04-13 14:59:17.000000000 +0200
@@ -102,6 +102,26 @@
 	--help)
 	    showhelp
 	    ;;
+	--quiet)
+	    if test ${VERBOSE:-1} = 1 ; then
+		VERBOSE=0
+		APTQUIET="-q -q"
+	    else
+		VERBOSE=1
+		APTQUIET="-q"
+	    fi
+	    shift;
+	    ;;
+	--verbose)
+	    if test ${VERBOSE:-1} = 1 ; then
+		VERBOSE=2
+		APTQUIET=""
+	    else
+		VERBOSE=1
+		APTQUIET="-q"
+	    fi
+	    shift;
+	    ;;
 	--) # end of processing for this
 	    shift;
 	    break;
diff -ur pbuilder-0.199+nmu3/pdebuild-internal pbuilder-0.199+nmu3+quiet//pdebuild-internal
--- pbuilder-0.199+nmu3/pdebuild-internal	2010-07-05 15:10:03.000000000 +0200
+++ pbuilder-0.199+nmu3+quiet//pdebuild-internal	2011-04-13 14:59:17.000000000 +0200
@@ -30,7 +30,7 @@
 
 # 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

Reply via email to