From: Anthony PERARD Subject: Re: [PATCH 3/3] raisin: improve output Date: Thu, 30 Apr 2015 16:10:57 +0100 Message-ID: <20150430151057.GD12602@perard.uk.xensource.com> References: <1430326856-15695-3-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1430326856-15695-3-git-send-email-stefano.stabellini@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: george.dunlap@eu.citrix.com, xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Wed, Apr 29, 2015 at 06:00:56PM +0100, Stefano Stabellini wrote: > Introduce an error_echo function that prints to stderr. > Call error_echo or verbose_echo, instead of echo, when possible and > appropriate. > Redirect build and tests output to /dev/null unless VERBOSE==1. > Redirect apt-get and yum output to /dev/null. > Fix echo arguments in check-package-deb. > > Signed-off-by: Stefano Stabellini > --- > components/grub | 4 +-- > components/libvirt | 4 +-- > components/linux | 2 +- > components/ovmf | 6 ++-- > components/qemu | 2 +- > components/qemu_traditional | 2 +- > components/seabios | 6 ++-- > components/xen | 8 ++--- > lib/commands.sh | 18 +++++------ > lib/common-functions.sh | 72 ++++++++++++++++++++++++++++++------------- > lib/common-tests.sh | 6 ++-- > tests/busybox-hvm | 2 +- > 12 files changed, 80 insertions(+), 52 deletions(-) > [...] > diff --git a/lib/common-functions.sh b/lib/common-functions.sh > index 2edb168..f293ff4 100644 > --- a/lib/common-functions.sh > +++ b/lib/common-functions.sh > @@ -3,10 +3,14 @@ > function verbose_echo() { > if [[ $VERBOSE -eq 1 ]] > then > - echo $* > + echo "$PREPEND" $* > fi > } > > +function error_echo() { > + echo "$PREPEND" $* >&2 I think using "$@" (with the quote) instead of $* would be better. The quotes will keep any space that you want to echo and using $@ instead of $* will keep parameters separated. So calling error_echo would have the same beavior as calling echo (well almost). Same thing for verbose_echo. > +} > + -- Anthony PERARD