[PATCH modular 7/8] build.sh: improve error msg by adding full make command

Peter Hutterer peter.hutterer at who-t.net
Tue Jan 4 14:48:07 PST 2011


On Tue, 04 Jan 2011 15:44:41 -0500, Gaetan Nadon <memsize at videotron.ca> wrote:
> Sample out put:
> ***** "make -f bad" failed on app/xclock
> 
> As opposed to:
> ***** make failed on app/xclock
> 
> Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
> ---
>  build.sh |   14 +++++++-------
>  1 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/build.sh b/build.sh
> index a532609..3af85cf 100755
> --- a/build.sh
> +++ b/build.sh
> @@ -137,7 +137,7 @@ setup_buildenv() {
>  # returns:
>  #   (irrelevant)
>  failed() {
> -    echo "***** $1 failed on $2/$3"
> +    echo "***** \"$1\" failed on $2/$3"

same goes here btw, it'd be much nicer to read if you could swap $1
etc. over for meaningful names. just reading this context, I'd have no
idea what the error would convey.

same goes for e.g. process() too. but this can be a follow-up patch
again,
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

for this one.

>      failed_components="$failed_components $2/$3"
>  }
>  
> @@ -437,7 +437,7 @@ process() {
>  
>      ${MAKE} $MAKEFLAGS
>      if [ $? -ne 0 ]; then
> -	failed make $1 $2
> +	failed "$MAKE $MAKEFLAGS" $1 $2
>  	cd $old_pwd
>  	return 1
>      fi
> @@ -445,7 +445,7 @@ process() {
>      if [ X"$CHECK" != X ]; then
>  	${MAKE} $MAKEFLAGS check
>  	if [ $? -ne 0 ]; then
> -	    failed check $1 $2
> +	    failed "$MAKE $MAKEFLAGS check" $1 $2
>  	    cd $old_pwd
>  	    return 1
>  	fi
> @@ -454,7 +454,7 @@ process() {
>      if [ X"$CLEAN" != X ]; then
>  	${MAKE} $MAKEFLAGS clean
>  	if [ $? -ne 0 ]; then
> -	    failed clean $1 $2
> +	    failed "$MAKE $MAKEFLAGS clean" $1 $2
>  	    cd $old_pwd
>  	    return 1
>  	fi
> @@ -463,7 +463,7 @@ process() {
>      if [ X"$DIST" != X ]; then
>  	${MAKE} $MAKEFLAGS dist
>  	if [ $? -ne 0 ]; then
> -	    failed dist $1 $2
> +	    failed "$MAKE $MAKEFLAGS dist" $1 $2
>  	    cd $old_pwd
>  	    return 1
>  	fi
> @@ -472,7 +472,7 @@ process() {
>      if [ X"$DISTCHECK" != X ]; then
>  	${MAKE} $MAKEFLAGS distcheck
>  	if [ $? -ne 0 ]; then
> -	    failed distcheck $1 $2
> +	    failed "$MAKE $MAKEFLAGS distcheck" $1 $2
>  	    cd $old_pwd
>  	    return 1
>  	fi
> @@ -480,7 +480,7 @@ process() {
>  
>      $SUDO env LD_LIBRARY_PATH=$LD_LIBRARY_PATH ${MAKE} $MAKEFLAGS install
>      if [ $? -ne 0 ]; then
> -	failed install $1 $2
> +	failed "$SUDO env LD_LIBRARY_PATH=$LD_LIBRARY_PATH $MAKE $MAKEFLAGS install" $1 $2
>  	cd $old_pwd
>  	return 1
>      fi
> -- 
> 1.6.0.4




More information about the xorg-devel mailing list