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

Eric Blake eblake at redhat.com
Tue Feb 23 00:01:31 UTC 2010


* 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
-- 
1.6.6




More information about the libvir-list mailing list