[libvirt] [PATCH 1/4] maint: fix quoting in autogen.sh

Daniel P. Berrange berrange at redhat.com
Tue Feb 23 07:52:59 UTC 2010


On Mon, Feb 22, 2010 at 05:01:31PM -0700, Eric Blake wrote:
> * autogen.sh (srcdir, THEDIR, OBJ_DIR): Use proper quoting.
> (.git-module-status): Abort if bootstrap fails.
> ---
> 
> I needed this while working on later patches in the series.  It's
> still not completely robust (for example, if srcdir is relative and
> starts with -), but at least it allows spaces in file names now.  More
> importantly, failure during the bootstrap script no longer continues
> trying to run configure anyway.
> 
>  autogen.sh |   13 ++++++++-----
>  1 files changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/autogen.sh b/autogen.sh
> index 1ddc251..93538f9 100755
> --- a/autogen.sh
> +++ b/autogen.sh
> @@ -1,11 +1,11 @@
>  #!/bin/sh
>  # Run this to generate all the initial makefiles, etc.
> 
> -srcdir=`dirname $0`
> +srcdir=`dirname "$0"`
>  test -z "$srcdir" && srcdir=.
> 
>  THEDIR=`pwd`
> -cd $srcdir
> +cd "$srcdir"
>  DIE=0
> 
>  (autopoint --version) < /dev/null > /dev/null 2>&1 || {
> @@ -70,7 +70,10 @@ if test "$t" = "$(cat $curr_status 2>/dev/null)"; then
>      : # good, it's up to date
>  else
>    echo running bootstrap...
> -  ./bootstrap && echo "$t" > $curr_status
> +  ./bootstrap && echo "$t" > $curr_status || {
> +    echo "Failed to bootstrap gnulib, please investigate."
> +    exit 1;
> +  }
>  fi
> 
>  # Automake requires that ChangeLog exist.
> @@ -78,9 +81,9 @@ touch ChangeLog
> 
>  autoreconf -if
> 
> -cd $THEDIR
> +cd "$THEDIR"
> 
> -if test x$OBJ_DIR != x; then
> +if test "x$OBJ_DIR" != x; then
>      mkdir -p "$OBJ_DIR"
>      cd "$OBJ_DIR"
>  fi
> -- 

ACK

Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list