mirror of https://github.com/python/cpython.git
Always set SVNVERSION to "exported" if it otherwise fails.
This commit is contained in:
parent
dea59e5755
commit
c5bf5a00a3
|
@ -438,7 +438,7 @@ Modules/getbuildinfo.o: $(PARSER_OBJS) \
|
||||||
$(SIGNAL_OBJS) \
|
$(SIGNAL_OBJS) \
|
||||||
$(MODOBJS) \
|
$(MODOBJS) \
|
||||||
$(srcdir)/Modules/getbuildinfo.c
|
$(srcdir)/Modules/getbuildinfo.c
|
||||||
$(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LANG=C $(SVNVERSION) $(srcdir)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
$(CC) -c $(PY_CFLAGS) -DSVNVERSION=\"`LANG=C $(SVNVERSION)`\" -o $@ $(srcdir)/Modules/getbuildinfo.c
|
||||||
|
|
||||||
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
|
Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
|
||||||
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
|
$(CC) -c $(PY_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
|
||||||
|
|
|
@ -28,15 +28,17 @@ Py_GetBuildInfo(void)
|
||||||
{
|
{
|
||||||
static char buildinfo[50];
|
static char buildinfo[50];
|
||||||
#ifdef SVNVERSION
|
#ifdef SVNVERSION
|
||||||
static char svnversion[] = SVNVERSION;
|
static char svnversion[50] = SVNVERSION;
|
||||||
#else
|
#else
|
||||||
static char svnversion[20] = "unknown";
|
static char svnversion[50] = "exported";
|
||||||
if (strstr(headurl, "/tags/") != NULL) {
|
#endif
|
||||||
int start = ;
|
if (strcmp(svnversion, "exported") == 0 &&
|
||||||
|
strstr(headurl, "/tags/") != NULL) {
|
||||||
|
int start = 11;
|
||||||
|
int stop = strlen(revision)-2;
|
||||||
strncpy(svnversion, revision+start, stop-start);
|
strncpy(svnversion, revision+start, stop-start);
|
||||||
svnversion[stop-start] = '\0';
|
svnversion[stop-start] = '\0';
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
PyOS_snprintf(buildinfo, sizeof(buildinfo),
|
PyOS_snprintf(buildinfo, sizeof(buildinfo),
|
||||||
"%s, %.20s, %.9s", svnversion, DATE, TIME);
|
"%s, %.20s, %.9s", svnversion, DATE, TIME);
|
||||||
return buildinfo;
|
return buildinfo;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# From configure.in Revision: 41852 .
|
# From configure.in Revision: 41923 .
|
||||||
# Guess values for system-dependent variables and create Makefiles.
|
# Guess values for system-dependent variables and create Makefiles.
|
||||||
# Generated by GNU Autoconf 2.59 for python 2.5.
|
# Generated by GNU Autoconf 2.59 for python 2.5.
|
||||||
#
|
#
|
||||||
|
@ -3576,10 +3576,8 @@ test -n "$AR" || AR="ar"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ac_prog in svnversion
|
# Extract the first word of "svnversion", so it can be a program name with args.
|
||||||
do
|
set dummy svnversion; ac_word=$2
|
||||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
|
||||||
set dummy $ac_prog; ac_word=$2
|
|
||||||
echo "$as_me:$LINENO: checking for $ac_word" >&5
|
echo "$as_me:$LINENO: checking for $ac_word" >&5
|
||||||
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
|
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
|
||||||
if test "${ac_cv_prog_SVNVERSION+set}" = set; then
|
if test "${ac_cv_prog_SVNVERSION+set}" = set; then
|
||||||
|
@ -3595,7 +3593,7 @@ do
|
||||||
test -z "$as_dir" && as_dir=.
|
test -z "$as_dir" && as_dir=.
|
||||||
for ac_exec_ext in '' $ac_executable_extensions; do
|
for ac_exec_ext in '' $ac_executable_extensions; do
|
||||||
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
|
||||||
ac_cv_prog_SVNVERSION="$ac_prog"
|
ac_cv_prog_SVNVERSION="found"
|
||||||
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
|
||||||
break 2
|
break 2
|
||||||
fi
|
fi
|
||||||
|
@ -3613,10 +3611,12 @@ else
|
||||||
echo "${ECHO_T}no" >&6
|
echo "${ECHO_T}no" >&6
|
||||||
fi
|
fi
|
||||||
|
|
||||||
test -n "$SVNVERSION" && break
|
if test $SVNVERSION = found
|
||||||
done
|
then
|
||||||
test -n "$SVNVERSION" || SVNVERSION="echo no svnversion"
|
SVNVERSION="svnversion \$(srcdir)"
|
||||||
|
else
|
||||||
|
SVNVERSION="echo exported"
|
||||||
|
fi
|
||||||
|
|
||||||
case $MACHDEP in
|
case $MACHDEP in
|
||||||
bsdos*|hp*|HP*)
|
bsdos*|hp*|HP*)
|
||||||
|
|
|
@ -619,7 +619,13 @@ AC_SUBST(AR)
|
||||||
AC_CHECK_PROGS(AR, ar aal, ar)
|
AC_CHECK_PROGS(AR, ar aal, ar)
|
||||||
|
|
||||||
AC_SUBST(SVNVERSION)
|
AC_SUBST(SVNVERSION)
|
||||||
AC_CHECK_PROGS(SVNVERSION, svnversion, [echo no svnversion])
|
AC_CHECK_PROG(SVNVERSION, svnversion, found)
|
||||||
|
if test $SVNVERSION = found
|
||||||
|
then
|
||||||
|
SVNVERSION="svnversion \$(srcdir)"
|
||||||
|
else
|
||||||
|
SVNVERSION="echo exported"
|
||||||
|
fi
|
||||||
|
|
||||||
case $MACHDEP in
|
case $MACHDEP in
|
||||||
bsdos*|hp*|HP*)
|
bsdos*|hp*|HP*)
|
||||||
|
|
Loading…
Reference in New Issue