[libvirt] [PATCH] run bootstrap if .gnulib is not present

Hu Tao hutao at cn.fujitsu.com
Fri Nov 9 08:47:04 UTC 2012

If .gnulib is deleted unexpectedly, autogen.sh will fail with message:

fatal: ambiguous argument '.gnulib': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

which is actually given by git diff .gnulib, which doesn't exist.

In the case to run bootstrap to create .gnulib.

 autogen.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/autogen.sh b/autogen.sh
index d183397..07c58a1 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -62,7 +62,9 @@ bootstrap_hash()
 # Only run bootstrap from a git checkout, never from a tarball.
 if test -d .git; then
-    t=$(bootstrap_hash; git diff .gnulib)
+    if test -d .gnulib; then
+        t=$(bootstrap_hash; git diff .gnulib)
+    fi
     case $t:${CLEAN_SUBMODULE+set} in
         *:set) ;;

More information about the libvir-list mailing list