summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-02-01 23:45:10 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2016-02-01 23:50:28 -0800
commitc04e91134f256be298d8739d493aa8df7e8d05ec (patch)
tree25bc43b2fa08d4f391920792a6e3368fb9a69496 /autogen.sh
parent57134666465488819ac1fe0678484eefb9bd7853 (diff)
downloademacs-c04e91134f256be298d8739d493aa8df7e8d05ec.tar.gz
Add --git-config option to autogen.sh
* autogen.sh: New options --git-config, --help. (git_config): New shell var. Alter function to respect this var.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh25
1 files changed, 22 insertions, 3 deletions
diff --git a/autogen.sh b/autogen.sh
index 42a779ea8c8..4a0fbb791e9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -104,6 +104,21 @@ check_version ()
}
+git_config=true
+
+for arg
+do
+ case $arg in
+ --git-config=false) git_config=false;;
+ --git-config=true) git_config=true ;;
+ --help)
+ exec echo "$0: usage: $0 [--help|--git-config=[false|true]]";;
+ *)
+ echo >&2 "$0: $arg: unknown option"; exit 1;;
+ esac
+done
+
+
cat <<EOF
Checking whether you have the necessary tools...
(Read INSTALL.REPO for more details on building Emacs)
@@ -220,17 +235,21 @@ echo timestamp > src/stamp-h.in || exit
## Configure Git, if using Git.
if test -d .git && (git status -s) >/dev/null 2>&1; then
- # Like 'git config NAME VALUE', but verbose on change and exit on failure.
+ # Like 'git config NAME VALUE', but conditional on --git-config,
+ # verbose on change, and exiting on failure.
git_config ()
{
name=$1
value=$2
- ovalue=`git config --get "$name"` && test "$ovalue" = "$value" || {
+
+ if $git_config; then
+ ovalue=`git config --get "$name"` && test "$ovalue" = "$value" || {
echo "${Configuring_git}git config $name '$value'"
Configuring_git=
git config "$name" "$value" || exit
- }
+ }
+ fi
}
Configuring_git='Configuring git...
'