aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2016-02-01 23:45:10 -0800
committerPaul Eggert2016-02-01 23:50:28 -0800
commitc04e91134f256be298d8739d493aa8df7e8d05ec (patch)
tree25bc43b2fa08d4f391920792a6e3368fb9a69496
parent57134666465488819ac1fe0678484eefb9bd7853 (diff)
downloademacs-c04e91134f256be298d8739d493aa8df7e8d05ec.tar.gz
emacs-c04e91134f256be298d8739d493aa8df7e8d05ec.zip
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.
-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 ()
104} 104}
105 105
106 106
107git_config=true
108
109for arg
110do
111 case $arg in
112 --git-config=false) git_config=false;;
113 --git-config=true) git_config=true ;;
114 --help)
115 exec echo "$0: usage: $0 [--help|--git-config=[false|true]]";;
116 *)
117 echo >&2 "$0: $arg: unknown option"; exit 1;;
118 esac
119done
120
121
107cat <<EOF 122cat <<EOF
108Checking whether you have the necessary tools... 123Checking whether you have the necessary tools...
109(Read INSTALL.REPO for more details on building Emacs) 124(Read INSTALL.REPO for more details on building Emacs)
@@ -220,17 +235,21 @@ echo timestamp > src/stamp-h.in || exit
220## Configure Git, if using Git. 235## Configure Git, if using Git.
221if test -d .git && (git status -s) >/dev/null 2>&1; then 236if test -d .git && (git status -s) >/dev/null 2>&1; then
222 237
223 # Like 'git config NAME VALUE', but verbose on change and exit on failure. 238 # Like 'git config NAME VALUE', but conditional on --git-config,
239 # verbose on change, and exiting on failure.
224 240
225 git_config () 241 git_config ()
226 { 242 {
227 name=$1 243 name=$1
228 value=$2 244 value=$2
229 ovalue=`git config --get "$name"` && test "$ovalue" = "$value" || { 245
246 if $git_config; then
247 ovalue=`git config --get "$name"` && test "$ovalue" = "$value" || {
230 echo "${Configuring_git}git config $name '$value'" 248 echo "${Configuring_git}git config $name '$value'"
231 Configuring_git= 249 Configuring_git=
232 git config "$name" "$value" || exit 250 git config "$name" "$value" || exit
233 } 251 }
252 fi
234 } 253 }
235 Configuring_git='Configuring git... 254 Configuring_git='Configuring git...
236' 255'