]> Savannah Git Hosting - gnulib.git/commitdiff
bootstrap: add option hooks
authorJose E. Marchesi <jemarch@gnu.org>
Sun, 22 Nov 2020 23:04:03 +0000 (15:04 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 22 Nov 2020 23:04:03 +0000 (15:04 -0800)
* build-aux/bootstrap (bootstrap_print_option_usage_hook): Define.
(bootstrap_option_hook): Likewise.
(usage): Call bootstrap_print_option_usage_hook.

ChangeLog
build-aux/bootstrap

index ce6c8ac31f36b2e1502c33ad3765f071a0c6b8c0..6845d1a409f50cae7e7a5e57202fa9aaa661fbb5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2020-11-22  Jose E. Marchesi  <jemarch@gnu.org>
+
+       bootstrap: add option hooks
+       * build-aux/bootstrap (bootstrap_print_option_usage_hook): Define.
+       (bootstrap_option_hook): Likewise.
+       (usage): Call bootstrap_print_option_usage_hook.
+
 2020-11-22  Bruno Haible  <bruno@clisp.org>
 
        argp: Don't break getprogname on non-glibc systems.
index 8f76d696213ae5b1827b44c351e7c667f498cbd7..5f1b1b70c08cb94d688a3eff934c7ba96462c64c 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2020-04-13.15; # UTC
+scriptversion=2020-11-18.17; # UTC
 
 # Bootstrap this package from checked-out sources.
 
@@ -71,7 +71,9 @@ Options:
  --no-git                 do not use git to update gnulib.  Requires that
                           --gnulib-srcdir point to a correct gnulib snapshot
  --skip-po                do not download po files
-
+EOF
+  bootstrap_print_option_usage_hook
+  cat <<EOF
 If the file $me.conf exists in the same directory as this script, its
 contents are read as shell variables to configure the bootstrap.
 
@@ -154,6 +156,18 @@ gnulib_files=
 : ${AUTOPOINT=autopoint}
 : ${AUTORECONF=autoreconf}
 
+# A function to be called for each unrecognized option.  Returns 0 if
+# the option in $1 has been processed by the function.  Returns 1 if
+# the option has not been processed by the function.  Override it via
+# your own definition in bootstrap.conf
+
+bootstrap_option_hook() { return 1; }
+
+# A function to be called in order to print the --help information
+# corresponding to user-defined command-line options.
+
+bootstrap_print_option_usage_hook() { :; }
+
 # A function to be called right after gnulib-tool is run.
 # Override it via your own definition in bootstrap.conf.
 bootstrap_post_import_hook() { :; }
@@ -335,7 +349,7 @@ do
   --no-git)
     use_git=false;;
   *)
-    die "$option: unknown option";;
+    bootstrap_option_hook $option || die "$option: unknown option";;
   esac
 done