>Number: 2113
>Category: config
>Synopsis: HTTP Server Rebuild Line Needs Changing for the better
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apache
>State: open
>Class: change-request
>Submitter-Id: apache
>Arrival-Date: Wed Apr 22 06:10:01 PDT 1998
>Last-Modified:
>Originator: [EMAIL PROTECTED]
>Organization:
apache
>Release: 1.3b6
>Environment:
UNIX
>Description:
When you perform a recompilation, the current buildmark stuff inserts only
the C compiler date and time. One problem with this is that this is not
the "standard" UNIX date/time format....The other problem is that one is
unable to more easily assign a number to the build like most UNIX system
or software generations. There should be a counter that increments each
time a httpd is rebuilt.
The attached set of context diffs into the .../src/ area addresses the
above problems. Basically a simple
/bin/sh program is called creating an include file containing the string.
A few minor changes are required to do this (see the patch below).
The string for the server built date looks like
Tue Apr 21 08:48:41 PDT 1998 - Build #14
Which is nicer.
>How-To-Repeat:
All the time....
>Fix:
*** Makefile.tmpl.dist Mon Apr 20 17:27:36 1998
--- Makefile.tmpl Mon Apr 20 17:34:30 1998
***************
*** 26,31 ****
--- 26,32 ----
$(TARGET): $(SUBTARGET)
target_static: subdirs modules.o
+ /bin/sh buildmark.sh
$(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) buildmark.c
$(CC) $(CFLAGS) $(LDFLAGS) $(LDFLAGS_SHLIB_EXPORT) \
-o $(TARGET) buildmark.o $(OBJS) $(REGLIB) $(LIBS)
*** buildmark.c.dist Mon Apr 20 17:22:17 1998
--- buildmark.c Mon Apr 20 17:25:06 1998
***************
*** 57,68 ****
#include "conf.h"
#include "httpd.h"
- #if defined(__DATE__) && defined(__TIME__)
- static const char server_built[] = __DATE__ " " __TIME__;
- #else
- static const char server_built[] = "unknown";
- #endif
static const char server_version[] = SERVER_VERSION;
API_EXPORT(const char *) ap_get_server_built()
--- 57,64 ----
#include "conf.h"
#include "httpd.h"
+ #include "buildmark.h"
static const char server_version[] = SERVER_VERSION;
API_EXPORT(const char *) ap_get_server_built()
*** buildmark.count.dist Wed Apr 22 05:54:40 1998
--- buildmark.count Tue Apr 21 16:21:36 1998
***************
*** 0 ****
--- 1 ----
+ 1
*** buildmark.sh.dist Wed Apr 22 05:55:15 1998
--- buildmark.sh Mon Apr 20 17:24:31 1998
***************
*** 0 ****
--- 1,9 ----
+ #! /bin/sh
+ set -uh
+ datx=`date`
+ versx=`cat buildmark.count`
+ versx=`expr $versx + 1`
+ echo .....Making Build Number $versx 1>&2
+ echo $versx >buildmark.count
+ echo 'const char server_built[] = "'"$datx"' - Build #'"$versx"'";'
>buildmark.h
+ exit 0
%0
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED. This is not done]
[automatically because of the potential for mail loops. ]