Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c5bf5a0

Browse files
committed
Always set SVNVERSION to "exported" if it otherwise fails.
1 parent dea59e5 commit c5bf5a0

4 files changed

Lines changed: 25 additions & 17 deletions

File tree

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
438438
$(SIGNAL_OBJS) \
439439
$(MODOBJS) \
440440
$(srcdir)/Modules/getbuildinfo.c
441-
$(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LANG=C $(SVNVERSION) $(srcdir)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
441+
$(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LANG=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
442442

443443
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
444444
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \

Modules/getbuildinfo.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ Py_GetBuildInfo(void)
2828
{
2929
static char buildinfo[50];
3030
#ifdef SVNVERSION
31-
static char svnversion[] = SVNVERSION;
31+
static char svnversion[50] = SVNVERSION;
3232
#else
33-
static char svnversion[20] = "unknown";
34-
if (strstr(headurl, "/tags/") != NULL) {
35-
int start = ;
33+
static char svnversion[50] = "exported";
34+
#endif
35+
if (strcmp(svnversion, "exported") == 0 &&
36+
strstr(headurl, "/tags/") != NULL) {
37+
int start = 11;
38+
int stop = strlen(revision)-2;
3639
strncpy(svnversion, revision+start, stop-start);
3740
svnversion[stop-start] = '\0';
3841
}
39-
#endif
4042
PyOS_snprintf(buildinfo, sizeof(buildinfo),
4143
"%s, %.20s, %.9s", svnversion, DATE, TIME);
4244
return buildinfo;

configure

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# From configure.in Revision: 41852 .
2+
# From configure.in Revision: 41923 .
33
# Guess values for system-dependent variables and create Makefiles.
44
# Generated by GNU Autoconf 2.59 for python 2.5.
55
#
@@ -3576,10 +3576,8 @@ test -n "$AR" || AR="ar"
35763576

35773577

35783578

3579-
for ac_prog in svnversion
3580-
do
3581-
# Extract the first word of "$ac_prog", so it can be a program name with args.
3582-
set dummy $ac_prog; ac_word=$2
3579+
# Extract the first word of "svnversion", so it can be a program name with args.
3580+
set dummy svnversion; ac_word=$2
35833581
echo "$as_me:$LINENO: checking for $ac_word" >&5
35843582
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
35853583
if test "${ac_cv_prog_SVNVERSION+set}" = set; then
@@ -3595,7 +3593,7 @@ do
35953593
test -z "$as_dir" && as_dir=.
35963594
for ac_exec_ext in '' $ac_executable_extensions; do
35973595
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3598-
ac_cv_prog_SVNVERSION="$ac_prog"
3596+
ac_cv_prog_SVNVERSION="found"
35993597
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
36003598
break 2
36013599
fi
@@ -3613,10 +3611,12 @@ else
36133611
echo "${ECHO_T}no" >&6
36143612
fi
36153613

3616-
test -n "$SVNVERSION" && break
3617-
done
3618-
test -n "$SVNVERSION" || SVNVERSION="echo no svnversion"
3619-
3614+
if test $SVNVERSION = found
3615+
then
3616+
SVNVERSION="svnversion \$(srcdir)"
3617+
else
3618+
SVNVERSION="echo exported"
3619+
fi
36203620

36213621
case $MACHDEP in
36223622
bsdos*|hp*|HP*)

configure.in

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,13 @@ AC_SUBST(AR)
619619
AC_CHECK_PROGS(AR, ar aal, ar)
620620

621621
AC_SUBST(SVNVERSION)
622-
AC_CHECK_PROGS(SVNVERSION, svnversion, [echo no svnversion])
622+
AC_CHECK_PROG(SVNVERSION, svnversion, found)
623+
if test $SVNVERSION = found
624+
then
625+
SVNVERSION="svnversion \$(srcdir)"
626+
else
627+
SVNVERSION="echo exported"
628+
fi
623629

624630
case $MACHDEP in
625631
bsdos*|hp*|HP*)

0 commit comments

Comments
 (0)