Skip to content

Commit 4c85557

Browse files
authored
bpo-30411: Use --git-dir instead of -C to make git work under version below 1.8.5. (GH-8744)
1 parent 74a307d commit 4c85557

File tree

2 files changed

+7
-19
lines changed

2 files changed

+7
-19
lines changed

configure

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,6 @@ infodir
781781
docdir
782782
oldincludedir
783783
includedir
784-
runstatedir
785784
localstatedir
786785
sharedstatedir
787786
sysconfdir
@@ -891,7 +890,6 @@ datadir='${datarootdir}'
891890
sysconfdir='${prefix}/etc'
892891
sharedstatedir='${prefix}/com'
893892
localstatedir='${prefix}/var'
894-
runstatedir='${localstatedir}/run'
895893
includedir='${prefix}/include'
896894
oldincludedir='/usr/include'
897895
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1144,15 +1142,6 @@ do
11441142
| -silent | --silent | --silen | --sile | --sil)
11451143
silent=yes ;;
11461144

1147-
-runstatedir | --runstatedir | --runstatedi | --runstated \
1148-
| --runstate | --runstat | --runsta | --runst | --runs \
1149-
| --run | --ru | --r)
1150-
ac_prev=runstatedir ;;
1151-
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1152-
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1153-
| --run=* | --ru=* | --r=*)
1154-
runstatedir=$ac_optarg ;;
1155-
11561145
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
11571146
ac_prev=sbindir ;;
11581147
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1290,7 +1279,7 @@ fi
12901279
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
12911280
datadir sysconfdir sharedstatedir localstatedir includedir \
12921281
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1293-
libdir localedir mandir runstatedir
1282+
libdir localedir mandir
12941283
do
12951284
eval ac_val=\$$ac_var
12961285
# Remove trailing slashes.
@@ -1443,7 +1432,6 @@ Fine tuning of the installation directories:
14431432
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14441433
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14451434
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
1446-
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
14471435
--libdir=DIR object code libraries [EPREFIX/lib]
14481436
--includedir=DIR C header files [PREFIX/include]
14491437
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -2757,9 +2745,9 @@ HAS_GIT=no-repository
27572745
fi
27582746
if test $HAS_GIT = found
27592747
then
2760-
GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
2761-
GITTAG="git -C \$(srcdir) describe --all --always --dirty"
2762-
GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
2748+
GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
2749+
GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
2750+
GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
27632751
else
27642752
GITVERSION=""
27652753
GITTAG=""

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ HAS_GIT=no-repository
3939
fi
4040
if test $HAS_GIT = found
4141
then
42-
GITVERSION="git -C \$(srcdir) rev-parse --short HEAD"
43-
GITTAG="git -C \$(srcdir) describe --all --always --dirty"
44-
GITBRANCH="git -C \$(srcdir) name-rev --name-only HEAD"
42+
GITVERSION="git --git-dir \$(srcdir)/.git rev-parse --short HEAD"
43+
GITTAG="git --git-dir \$(srcdir)/.git describe --all --always --dirty"
44+
GITBRANCH="git --git-dir \$(srcdir)/.git name-rev --name-only HEAD"
4545
else
4646
GITVERSION=""
4747
GITTAG=""

0 commit comments

Comments
 (0)