diff --git a/Makefile.am b/Makefile.am index 04f6b6081..6eb6157b2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,14 +22,17 @@ logdir = @prefix@/logs BUILT_SOURCES = include/serno.h include/serno.h: - @if [ -d .git ] ; then \ - 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 ; \ + @if [ -d .git ]; then \ + revh=`git log -1 --date=format:%Y%m%d --pretty=format:%cd-%h`; \ + datecode=`git log -1 --date=format:%Y%m%d --pretty=format:%cd`; \ + if [ -n "$$revh" ]; then \ + 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 - @[ -f include/serno.h ] || echo '#define SERNO "unknown"' >include/serno.h install-data-hook: test -d ${DESTDIR}${logdir} || mkdir -p ${DESTDIR}${logdir} diff --git a/include/ircd.h b/include/ircd.h index 57f7c4bca..a53b10f74 100644 --- a/include/ircd.h +++ b/include/ircd.h @@ -61,6 +61,7 @@ extern const char *creation; extern const char *generation; extern const char *infotext[]; extern const char *serno; +extern const unsigned long int datecode; extern const char *ircd_version; extern const char *logFileName; extern const char *pidFileName; diff --git a/ircd/version.c.SH b/ircd/version.c.SH index d5e762061..c02158a3b 100644 --- a/ircd/version.c.SH +++ b/ircd/version.c.SH @@ -56,6 +56,7 @@ const char *generation = "$generation"; const char *creation = "$creation"; const char *ircd_version = PATCHLEVEL; const char *serno = SERNO; +const unsigned long int datecode = DATECODE; const char *infotext[] = { diff --git a/librb/Makefile.am b/librb/Makefile.am index bcfd61553..2cfeb8e2b 100644 --- a/librb/Makefile.am +++ b/librb/Makefile.am @@ -7,12 +7,6 @@ pkgconfig_DATA = librb.pc BUILT_SOURCES = include/serno.h +# NOTE: you'll want to change the below if you are unbundling include/serno.h: - @if [ -d .git ] ; then \ - 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 + @cp ../include/serno.h include/ diff --git a/librb/include/serno.h b/librb/include/serno.h index a4ba0547a..ea29b8389 100644 --- a/librb/include/serno.h +++ b/librb/include/serno.h @@ -1 +1,2 @@ -#define SERIALNUM "20081213_1-26296" +#define SERNO "20160307-34dbd2d" +#define DATECODE 20160307L diff --git a/librb/src/version.c.SH b/librb/src/version.c.SH index 51f977b86..6d0bf4426 100644 --- a/librb/src/version.c.SH +++ b/librb/src/version.c.SH @@ -47,7 +47,8 @@ $spitshell >version.c <