Skip to content

Commit

Permalink
Use gnulib from a submodule
Browse files Browse the repository at this point in the history
This allows us to record the exact changeset from gnulib that everybody
should be using.
  • Loading branch information
David Lutterkort committed Jul 19, 2010
1 parent d73eb0d commit 337a10c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "gnulib"]
path = .gnulib
url = git://git.sv.gnu.org/gnulib.git
1 change: 1 addition & 0 deletions .gnulib
Submodule .gnulib added at e240ab
34 changes: 20 additions & 14 deletions bootstrap
Expand Up @@ -33,25 +33,31 @@ do
esac
done

cleanup_gnulib() {
st=$?
rm -fr .gnulib
exit $st
}
# Get gnulib files.

case ${GNULIB_SRCDIR--} in
-)
if [ ! -d .gnulib ]; then
echo "$0: getting gnulib files..."
git submodule init || exit $?
git submodule update || exit $?
GNULIB_SRCDIR=.gnulib
;;
*)
# Redirect the gnulib submodule to the directory on the command line
# if possible.
if test -d "$GNULIB_SRCDIR"/.git && \
git config --file .gitmodules 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..."

trap cleanup_gnulib 1 2 13 15

git clone --depth 1 git://git.sv.gnu.org/gnulib .gnulib ||
cleanup_gnulib

trap - 1 2 13 15
git submodule update || exit $?
GNULIB_SRCDIR=.gnulib
else
echo >&2 "$0: invalid gnulib srcdir: $GNULIB_SRCDIR"
exit 1
fi
GNULIB_SRCDIR=.gnulib
;;
esac

gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
Expand Down

0 comments on commit 337a10c

Please sign in to comment.