summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2017-05-02 14:55:50 (GMT)
committerGitHub <noreply@github.com>2017-05-02 14:55:50 (GMT)
commit2c7085fd7b00cba8b5ab258c62453b6a12418b73 (patch)
treecdb3210f79dd0735494da3878fe3b49a8834453a /configure
parent6bed8f95d72f622cb916bcebad651ccd3de6fe9d (diff)
downloadcpython-2c7085fd7b00cba8b5ab258c62453b6a12418b73.zip
cpython-2c7085fd7b00cba8b5ab258c62453b6a12418b73.tar.gz
cpython-2c7085fd7b00cba8b5ab258c62453b6a12418b73.tar.bz2
bpo-27593: Get SCM build info from git instead of hg (#1327)
Based on commit 5c4b0d063aba0a68c325073f5f312a2c9f40d178 by Ned Deily, which is based on original patches by Brett Cannon and Steve Dower. Remove also the private _Py_svnversion() function and SVNVERSION variable. Note: Py_SubversionRevision() and Py_SubversionShortBranch() are unchanged, they are part of the public API.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure93
1 files changed, 26 insertions, 67 deletions
diff --git a/configure b/configure
index 35fbeac..7d1f4ad 100755
--- a/configure
+++ b/configure
@@ -683,11 +683,10 @@ MKDIR_P
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
-HAS_HG
-HGBRANCH
-HGTAG
-HGVERSION
-SVNVERSION
+HAS_GIT
+GITBRANCH
+GITTAG
+GITVERSION
ARFLAGS
ac_ct_AR
AR
@@ -5689,63 +5688,20 @@ then
fi
-# Extract the first word of "svnversion", so it can be a program name with args.
-set dummy svnversion; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_SVNVERSION+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test -n "$SVNVERSION"; then
- ac_cv_prog_SVNVERSION="$SVNVERSION" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_SVNVERSION="found"
- $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
- done
-IFS=$as_save_IFS
- test -z "$ac_cv_prog_SVNVERSION" && ac_cv_prog_SVNVERSION="not-found"
-fi
-fi
-SVNVERSION=$ac_cv_prog_SVNVERSION
-if test -n "$SVNVERSION"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SVNVERSION" >&5
-$as_echo "$SVNVERSION" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-if test $SVNVERSION = found
+if test -e $srcdir/.git/HEAD
then
- SVNVERSION="svnversion \$(srcdir)"
-else
- SVNVERSION="echo Unversioned directory"
-fi
-
-
-
-
-# Extract the first word of "hg", so it can be a program name with args.
-set dummy hg; ac_word=$2
+# Extract the first word of "git", so it can be a program name with args.
+set dummy git; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_HAS_HG+:} false; then :
+if ${ac_cv_prog_HAS_GIT+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test -n "$HAS_HG"; then
- ac_cv_prog_HAS_HG="$HAS_HG" # Let the user override the test.
+ if test -n "$HAS_GIT"; then
+ ac_cv_prog_HAS_GIT="$HAS_GIT" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -5754,7 +5710,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_HAS_HG="found"
+ ac_cv_prog_HAS_GIT="found"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -5762,28 +5718,31 @@ done
done
IFS=$as_save_IFS
- test -z "$ac_cv_prog_HAS_HG" && ac_cv_prog_HAS_HG="not-found"
+ test -z "$ac_cv_prog_HAS_GIT" && ac_cv_prog_HAS_GIT="not-found"
fi
fi
-HAS_HG=$ac_cv_prog_HAS_HG
-if test -n "$HAS_HG"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_HG" >&5
-$as_echo "$HAS_HG" >&6; }
+HAS_GIT=$ac_cv_prog_HAS_GIT
+if test -n "$HAS_GIT"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAS_GIT" >&5
+$as_echo "$HAS_GIT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
-if test $HAS_HG = found
+else
+HAS_GIT=no-repository
+fi
+if test $HAS_GIT = found
then
- HGVERSION="hg id -i \$(srcdir)"
- HGTAG="hg id -t \$(srcdir)"
- HGBRANCH="hg id -b \$(srcdir)"
+ GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
+ GITTAG="git -C \$(srcdir) describe --all --always --dirty"
+ GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
else
- HGVERSION=""
- HGTAG=""
- HGBRANCH=""
+ GITVERSION=""
+ GITTAG=""
+ GITBRANCH=""
fi
case $MACHDEP in