Halibut: Include NSIS svn revision in meta generator tag

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6192 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2011-12-03 18:16:36 +00:00
parent 1e138ea336
commit bd797ad934
3 changed files with 33 additions and 1 deletions

View file

@ -268,6 +268,7 @@ void licence(void);
/*
* version.c
*/
void initversionstring(void);
const char *const version;
/*

View file

@ -21,6 +21,8 @@ int main(int argc, char **argv)
int reportcols;
int debug;
initversionstring();
/*
* Set up initial (default) parameters.
*/

View file

@ -3,6 +3,8 @@
*/
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#ifndef VERSION
#define VER "anonymous build (" __DATE__ " " __TIME__ ")"
@ -10,4 +12,31 @@
#define VER "version " VERSION
#endif
const char *const version = "version 1.0 (NSIS Custom Build)";
#define VERSTRFMT "v1.0 (NSIS Custom Build, %s)"
#define VERSTRSCMREVMAX 20
static char versionbuf[sizeof(VERSTRFMT)-2+VERSTRSCMREVMAX];
const char *const version = versionbuf;
void initversionstring(void)
{
char scmverbuf[VERSTRSCMREVMAX+1];
int cchsvnrev = 0;
const char*svnproprev = "$Revision$";
if ('$' == *svnproprev++)
{
const char*p;
while('$' != *svnproprev && !isdigit(*svnproprev)) svnproprev++;
for (p = svnproprev; isdigit(*p); ++p) cchsvnrev++;
}
if (!cchsvnrev)
{
cchsvnrev = 1;
svnproprev = "?";
}
strcpy(scmverbuf, "SVN:r");
strncat(scmverbuf, svnproprev, cchsvnrev);
sprintf(versionbuf,VERSTRFMT,scmverbuf);
}