]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: make git submodule checking more reliable
authorJim Meyering <meyering@redhat.com>
Wed, 24 Feb 2010 11:01:09 +0000 (12:01 +0100)
committerJim Meyering <meyering@redhat.com>
Thu, 25 Feb 2010 12:35:03 +0000 (13:35 +0100)
* cfg.mk (_curr_status): Accommodate leading "+" or "-" in the output
of git submodule status.
* autogen.sh: Likewise.

autogen.sh
cfg.mk

index 833b1d18d04423ddd242c635e7f5d6d1be4db2c7..9ae8d679d719d6c7bbd9edb7c7af3a17bdc9f259 100755 (executable)
@@ -65,7 +65,7 @@ fi
 # Ensure that whenever we pull in a gnulib update or otherwise change to a
 # different version (i.e., when switching branches), we also rerun ./bootstrap.
 curr_status=.git-module-status
-t=$(git submodule status)
+t=$(git submodule status|sed 's/^[ +-]//;s/ .*//')
 if test "$t" = "$(cat $curr_status 2>/dev/null)"; then
     : # good, it's up to date, all we need is autoreconf
     autoreconf -if
diff --git a/cfg.mk b/cfg.mk
index 17bb3419fb9e84d3b8f59809e672a876f324e2d6..8317ae2b16ce46929d2f56c12c97ee31f4bac2c2 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -262,7 +262,9 @@ ifeq (0,$(MAKELEVEL))
   # submodule name.  Contrast these:
   # -b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib
   #  b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib (v0.0-2286-gb653eda)
-  _submodule_hash = sed 's/.//;s/ .*//'
+  # $ cat .git-module-status
+  # b653eda3ac4864de205419d9f41eec267cb89eeb
+  _submodule_hash = sed 's/^[ +-]//;s/ .*//'
   _update_required := $(shell                                          \
       actual=$$(git submodule status | $(_submodule_hash));            \
       stamp="$$($(_submodule_hash) $(_curr_status) 2>/dev/null)";      \