Skip to content

Commit 78363cc

Browse files
zhangyangyumiss-islington
authored andcommitted
bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (pythonGH-8744)
(cherry picked from commit 4c85557) Co-authored-by: Xiang Zhang <angwerzx@126.com>
1 parent e77cdae commit 78363cc

2 files changed

Lines changed: 7 additions & 19 deletions

File tree

‎configure‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,6 @@ infodir
784784
docdir
785785
oldincludedir
786786
includedir
787-
runstatedir
788787
localstatedir
789788
sharedstatedir
790789
sysconfdir
@@ -896,7 +895,6 @@ datadir='${datarootdir}'
896895
sysconfdir='${prefix}/etc'
897896
sharedstatedir='${prefix}/com'
898897
localstatedir='${prefix}/var'
899-
runstatedir='${localstatedir}/run'
900898
includedir='${prefix}/include'
901899
oldincludedir='/usr/include'
902900
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1149,15 +1147,6 @@ do
11491147
| -silent | --silent | --silen | --sile | --sil)
11501148
silent=yes ;;
11511149

1152-
-runstatedir | --runstatedir | --runstatedi | --runstated \
1153-
| --runstate | --runstat | --runsta | --runst | --runs \
1154-
| --run | --ru | --r)
1155-
ac_prev=runstatedir ;;
1156-
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1157-
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1158-
| --run=* | --ru=* | --r=*)
1159-
runstatedir=$ac_optarg ;;
1160-
11611150
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11621151
ac_prev=sbindir ;;
11631152
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1295,7 +1284,7 @@ fi
12951284
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12961285
datadir sysconfdir sharedstatedir localstatedir includedir \
12971286
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1298-
libdir localedir mandir runstatedir
1287+
libdir localedir mandir
12991288
do
13001289
eval ac_val=\$$ac_var
13011290
# Remove trailing slashes.
@@ -1448,7 +1437,6 @@ Fine tuning of the installation directories:
14481437
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14491438
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14501439
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1451-
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14521440
--libdir=DIR object code libraries [EPREFIX/lib]
14531441
--includedir=DIR C header files [PREFIX/include]
14541442
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -2758,9 +2746,9 @@ HAS_GIT=no-repository
27582746
fi
27592747
if test $HAS_GIT = found
27602748
then
2761-
GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
2762-
GITTAG="git -C \$(srcdir) describe --all --always --dirty"
2763-
GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
2749+
GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
2750+
GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
2751+
GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
27642752
else
27652753
GITVERSION=""
27662754
GITTAG=""

‎configure.ac‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ HAS_GIT=no-repository
3737
fi
3838
if test $HAS_GIT = found
3939
then
40-
GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
41-
GITTAG="git -C \$(srcdir) describe --all --always --dirty"
42-
GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
40+
GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
41+
GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
42+
GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
4343
else
4444
GITVERSION=""
4545
GITTAG=""

0 commit comments

Comments
 (0)