mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-16 18:47:32 -05:00
Rework versioning system to not depend on Subversion.
I've shifted away from using the SVN revision number as a monotonic version identifier (replacing it in the Windows version resource with a count of days since an arbitrary epoch), and I've removed all uses of SVN keyword expansion (replacing them with version information written out by Buildscr). While I'm at it, I've done a major rewrite of the affected code which centralises all the computation of the assorted version numbers and strings into Buildscr, so that they're all more or less alongside each other rather than scattered across multiple source files. I've also retired the MD5-based manifest file system. A long time ago, it seemed like a good idea to arrange that binaries of PuTTY would automatically cease to identify themselves as a particular upstream version number if any changes were made to the source code, so that if someone made a local tweak and distributed the result then I wouldn't get blamed for the results. Since then I've decided the whole idea is more trouble than it's worth, so now distribution tarballs will have version information baked in and people can just cope with that. [originally from svn r10262]
This commit is contained in:
55
version.c
55
version.c
@ -2,59 +2,16 @@
|
||||
* PuTTY version numbering
|
||||
*/
|
||||
|
||||
#define STR1(x) #x
|
||||
#define STR(x) STR1(x)
|
||||
|
||||
#ifdef INCLUDE_EMPTY_H
|
||||
/*
|
||||
* Horrible hack to force version.o to be rebuilt unconditionally in
|
||||
* the automake world: empty.h is an empty header file, created by the
|
||||
* makefile and forcibly updated every time make is run. Including it
|
||||
* here causes automake to track it as a dependency, which will cause
|
||||
* version.o to be rebuilt too.
|
||||
*
|
||||
* The space between # and include causes mkfiles.pl's dependency
|
||||
* scanner (for all other makefile types) to ignore this include,
|
||||
* which is correct because only the automake makefile passes
|
||||
* -DINCLUDE_EMPTY_H to enable it.
|
||||
* The difficult part of deciding what goes in these version strings
|
||||
* is done in Buildscr, and then written into version.h. All we have
|
||||
* to do here is to drop it into variables of the right names.
|
||||
*/
|
||||
# include "empty.h"
|
||||
#endif
|
||||
|
||||
#if defined SNAPSHOT
|
||||
#include "version.h"
|
||||
|
||||
#if defined SVN_REV
|
||||
#define SNAPSHOT_TEXT STR(SNAPSHOT) ":r" STR(SVN_REV)
|
||||
#else
|
||||
#define SNAPSHOT_TEXT STR(SNAPSHOT)
|
||||
#endif
|
||||
|
||||
char ver[] = "Development snapshot " SNAPSHOT_TEXT;
|
||||
char sshver[] = "PuTTY-Snapshot-" SNAPSHOT_TEXT;
|
||||
|
||||
#undef SNAPSHOT_TEXT
|
||||
|
||||
#elif defined RELEASE
|
||||
|
||||
char ver[] = "Release " STR(RELEASE);
|
||||
char sshver[] = "PuTTY-Release-" STR(RELEASE);
|
||||
|
||||
#elif defined PRERELEASE
|
||||
|
||||
char ver[] = "Pre-release " STR(PRERELEASE) ":r" STR(SVN_REV);
|
||||
char sshver[] = "PuTTY-Prerelease-" STR(PRERELEASE) ":r" STR(SVN_REV);
|
||||
|
||||
#elif defined SVN_REV
|
||||
|
||||
char ver[] = "Custom build r" STR(SVN_REV) ", " __DATE__ " " __TIME__;
|
||||
char sshver[] = "PuTTY-Custom-r" STR(SVN_REV);
|
||||
|
||||
#else
|
||||
|
||||
char ver[] = "Unidentified build, " __DATE__ " " __TIME__;
|
||||
char sshver[] = "PuTTY-Local: " __DATE__ " " __TIME__;
|
||||
|
||||
#endif
|
||||
char ver[] = TEXTVER;
|
||||
char sshver[] = SSHVER;
|
||||
|
||||
/*
|
||||
* SSH local version string MUST be under 40 characters. Here's a
|
||||
|
Reference in New Issue
Block a user