From: Paolo Bonzini Date: Thu, 2 Oct 2008 08:57:50 +0000 (+0200) Subject: have bootstrap initialize a `gnulib' submodule in a git checkout X-Git-Tag: v0.1~6915 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=9c9af489440fbc63e4c5eeb21b21aa5aa4520394;p=gnulib.git have bootstrap initialize a `gnulib' submodule in a git checkout 2008-10-02 Paolo Bonzini * build-aux/bootstrap: Recognize `gnulib' being a submodule in a git repository, and initialize/update it accordingly. --- diff --git a/ChangeLog b/ChangeLog index 057938c6f..06eba5e9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-02 Paolo Bonzini + + * build-aux/bootstrap: Recognize `gnulib' being a submodule in a + git repository, and initialize/update it accordingly. + 2008-10-02 Jim Meyering fts.c: sync with similar code from coreutils' remove.c diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 74fa3eb12..53f3817d3 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -224,11 +224,20 @@ cleanup_gnulib() { exit $status } +git_modules_config () { + GIT_CONFIG_LOCAL=.gitmodules git config "$@" +} + # Get gnulib files. case ${GNULIB_SRCDIR--} in -) - if [ ! -d gnulib ]; then + if git_modules_config submodule.gnulib.url >/dev/null; then + echo "$0: getting gnulib files..." + git submodule init || exit $? + git submodule update || exit $? + + elif [ ! -d gnulib ]; then echo "$0: getting gnulib files..." trap cleanup_gnulib 1 2 13 15 @@ -239,6 +248,20 @@ case ${GNULIB_SRCDIR--} in trap - 1 2 13 15 fi GNULIB_SRCDIR=gnulib + ;; +*) + # Redirect the gnulib submodule to the directory on the command line + # if possible. + if test -d "$GNULIB_SRCDIR"/.git && \ + git_modules_config submodule.gnulib.url >/dev/null; then + git submodule init + GNULIB_SRCDIR=`cd $GNULIB_SRCDIR && pwd` + git config --replace-all submodule.gnulib.url $GNULIB_SRCDIR + echo "$0: getting gnulib files..." + git submodule update || exit $? + GNULIB_SRCDIR=gnulib + fi + ;; esac gnulib_tool=$GNULIB_SRCDIR/gnulib-tool