[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/3] raisin: improve output



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 <stefano.stabellini@xxxxxxxxxxxxx>
> ---
>  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

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.