Mercurial > hg > octave-nkf > gnulib-hg
changeset 10567:9a78b559898a
have bootstrap initialize a `gnulib' submodule in a git checkout
2008-10-02 Paolo Bonzini <bonzini@gnu.org>
* build-aux/bootstrap: Recognize `gnulib' being a submodule in a
git repository, and initialize/update it accordingly.
author | Paolo Bonzini <bonzini@gnu.org> |
---|---|
date | Thu, 02 Oct 2008 10:57:50 +0200 |
parents | 18c6bf992870 |
children | b4acf1857e59 |
files | ChangeLog build-aux/bootstrap |
diffstat | 2 files changed, 29 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-02 Paolo Bonzini <bonzini@gnu.org> + + * build-aux/bootstrap: Recognize `gnulib' being a submodule in a + git repository, and initialize/update it accordingly. + 2008-10-02 Jim Meyering <meyering@redhat.com> fts.c: sync with similar code from coreutils' remove.c
--- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -224,11 +224,20 @@ 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 @@ 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