Permalink
Browse files

Use gnulib from a submodule

This allows us to record the exact changeset from gnulib that everybody
should be using.
  • Loading branch information...
1 parent d73eb0d commit 337a10c6685914e9504e17a2f1cc303969e9f5b3 @lutter committed Jul 19, 2010
Showing with 24 additions and 14 deletions.
  1. +3 −0 .gitmodules
  2. +1 −0 .gnulib
  3. +20 −14 bootstrap
View
@@ -0,0 +1,3 @@
+[submodule "gnulib"]
+ path = .gnulib
+ url = git://git.sv.gnu.org/gnulib.git
Submodule .gnulib added at e240ab
View
@@ -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

0 comments on commit 337a10c

Please sign in to comment.