Fix generation of serno.h

Due to reversed conditionals, it wasn't being generated properly.

This also actually fixes its generation in librb by just copying the
Charybdis version. Unbundlers will want to take note of this.
This commit is contained in:
Elizabeth Myers 2016-03-07 17:14:28 -06:00
parent c5baae2459
commit 749d697c98
6 changed files with 18 additions and 17 deletions

View file

@ -22,14 +22,17 @@ logdir = @prefix@/logs
BUILT_SOURCES = include/serno.h BUILT_SOURCES = include/serno.h
include/serno.h: include/serno.h:
@if [ -d .git ] ; then \ @if [ -d .git ]; then \
revh=`git log -1 --date=format:%Y%m%d --pretty=format:%cd-%h`;\ revh=`git log -1 --date=format:%Y%m%d --pretty=format:%cd-%h`; \
[ -z "$$revh" ] || echo '#define SERNO "'$$revh'"' >include/serno.h ; \ datecode=`git log -1 --date=format:%Y%m%d --pretty=format:%cd`; \
elif [ -d .hg ] ; then \ if [ -n "$$revh" ]; then \
revh=`hg parents --template '{date|shortdate}_{node|short}' 2>/dev/null | sed -e s/-//g -e s/_/-/`;\ echo '#define SERNO "'$$revh'"' >include/serno.h ; \
[ -z "$$revh" ] || echo '#define SERNO "'$$revh'"' >include/serno.h ; \ echo "#define DATECODE $${datecode}UL" >>include/serno.h; \
fi \
else \
echo '#define SERNO "unknown"' >include/serno.h; \
echo '#define DATECODE 0UL' >>include/serno.h; \
fi fi
@[ -f include/serno.h ] || echo '#define SERNO "unknown"' >include/serno.h
install-data-hook: install-data-hook:
test -d ${DESTDIR}${logdir} || mkdir -p ${DESTDIR}${logdir} test -d ${DESTDIR}${logdir} || mkdir -p ${DESTDIR}${logdir}

View file

@ -61,6 +61,7 @@ extern const char *creation;
extern const char *generation; extern const char *generation;
extern const char *infotext[]; extern const char *infotext[];
extern const char *serno; extern const char *serno;
extern const unsigned long int datecode;
extern const char *ircd_version; extern const char *ircd_version;
extern const char *logFileName; extern const char *logFileName;
extern const char *pidFileName; extern const char *pidFileName;

View file

@ -56,6 +56,7 @@ const char *generation = "$generation";
const char *creation = "$creation"; const char *creation = "$creation";
const char *ircd_version = PATCHLEVEL; const char *ircd_version = PATCHLEVEL;
const char *serno = SERNO; const char *serno = SERNO;
const unsigned long int datecode = DATECODE;
const char *infotext[] = const char *infotext[] =
{ {

View file

@ -7,12 +7,6 @@ pkgconfig_DATA = librb.pc
BUILT_SOURCES = include/serno.h BUILT_SOURCES = include/serno.h
# NOTE: you'll want to change the below if you are unbundling
include/serno.h: include/serno.h:
@if [ -d .git ] ; then \ @cp ../include/serno.h include/
revh=`git log -1 --date=format:%Y%m%d --pretty=format:%cd-%h`;\
[ -z "$$revh" ] || echo '#define SERNO "'$$revh'"' >include/serno.h ; \
elif [ -d .hg ] ; then \
revh=`hg parents --template '{date|shortdate}_{node|short}' 2>/dev/null | sed -e s/-//g -e s/_/-/`;\
[ -z "$$revh" ] || echo '#define SERNO "'$$revh'"' >include/serno.h ; \
fi
@[ -f include/serno.h ] || echo '#define SERNO "unknown"' >include/serno.h

View file

@ -1 +1,2 @@
#define SERIALNUM "20081213_1-26296" #define SERNO "20160307-34dbd2d"
#define DATECODE 20160307L

View file

@ -47,7 +47,8 @@ $spitshell >version.c <<!SUB!THIS!
#include "../include/serno.h" #include "../include/serno.h"
const char *librb_generation = "$generation"; const char *librb_generation = "$generation";
const char *librb_serno = SERIALNUM; const char *librb_serno = SERNO;
const unsigned long int librb_datecode = DATECODE;
const char *librb_infotext[] = const char *librb_infotext[] =
{ {