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:
parent
1e138ea336
commit
bd797ad934
3 changed files with 33 additions and 1 deletions
|
@ -268,6 +268,7 @@ void licence(void);
|
||||||
/*
|
/*
|
||||||
* version.c
|
* version.c
|
||||||
*/
|
*/
|
||||||
|
void initversionstring(void);
|
||||||
const char *const version;
|
const char *const version;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -21,6 +21,8 @@ int main(int argc, char **argv)
|
||||||
int reportcols;
|
int reportcols;
|
||||||
int debug;
|
int debug;
|
||||||
|
|
||||||
|
initversionstring();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Set up initial (default) parameters.
|
* Set up initial (default) parameters.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#ifndef VERSION
|
#ifndef VERSION
|
||||||
#define VER "anonymous build (" __DATE__ " " __TIME__ ")"
|
#define VER "anonymous build (" __DATE__ " " __TIME__ ")"
|
||||||
|
@ -10,4 +12,31 @@
|
||||||
#define VER "version " VERSION
|
#define VER "version " VERSION
|
||||||
#endif
|
#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);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue