]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
maint: Add --no-git option to autogen.sh
authorDaiki Ueno <ueno@gnu.org>
Wed, 18 May 2016 09:21:07 +0000 (18:21 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 18 May 2016 09:22:12 +0000 (18:22 +0900)
* autogen.sh: Port --no-git option from Gnulib's bootstrap.

autogen.sh

index 6790a2365497ed37f4def863047e64d47c5b440b..7a0a19a41ca103239f86df3ddae35897f1b49794 100755 (executable)
@@ -32,7 +32,7 @@
 # data files used by the autopoint program.  If you already have the
 # file, place it under gettext-tools/misc, before running this script.
 #
-# Usage: ./autogen.sh [--skip-gnulib]
+# Usage: ./autogen.sh [--skip-gnulib] [--no-git]
 #
 # Usage after a git clone:              ./autogen.sh
 # Usage from a released tarball:        ./autogen.sh --skip-gnulib
 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 skip_gnulib=false
+
+# Use git to update gnulib sources
+use_git=true
+
 while :; do
   case "$1" in
     --skip-gnulib) skip_gnulib=true; shift;;
+    --no-git) use_git=false; shift;;
     *) break ;;
   esac
 done
 
+$use_git || test -d "$GNULIB_SRCDIR" \
+  || die "Error: --no-git requires --gnulib-srcdir"
+
 cleanup_gnulib() {
   status=$?
   rm -fr "$gnulib_path"
@@ -90,7 +98,7 @@ if ! $skip_gnulib; then
     ;;
   *)
     # Use GNULIB_SRCDIR as a reference.
-    if test -d "$GNULIB_SRCDIR"/.git && \
+    if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
           git_modules_config submodule.gnulib.url >/dev/null; then
       echo "$0: getting gnulib files..."
       if git submodule -h|grep -- --reference > /dev/null; then