From: Simon Tatham Date: Sat, 21 Jan 2017 14:55:53 +0000 (+0000) Subject: Make bob builds show the full source git commit hash in buildinfo. X-Git-Tag: 0.68~84 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=5687a16fc1b60345c76d4f5088edc41004a3529d;p=PuTTY.git Make bob builds show the full source git commit hash in buildinfo. The Windows binaries, and both Windows and Unix source archives, output from a bob build will now include the full SHA-1 of the source git commit in their buildinfo (hence in all the About boxes and command-line version output). This will be occasionally useful to me at release time (there was that one embarrassing incident where I managed not to notice that I'd made a release build from entirely the wrong commit), but mostly, it just seems like an obviously useful thing to put in a general buildinfo section now that there is one. --- diff --git a/Buildscr b/Buildscr index a476ff75..ba55429f 100644 --- a/Buildscr +++ b/Buildscr @@ -126,6 +126,7 @@ ifneq "$(SNAPSHOT)" "" in putty do echo '$#define SNAPSHOT' >> version.h in putty do echo '$#define TEXTVER "$(Textver)"' >> version.h in putty do echo '$#define SSHVER "$(Sshver)"' >> version.h in putty do echo '$#define BINARY_VERSION $(Winvercommas)' >> version.h +in putty do echo '$#define SOURCE_COMMIT "$(vcsfullid)"' >> version.h # Set up the extra arguments for the main Windows nmake command. The # user can define XFLAGS and MAKEARGS on the bob command line, to pass diff --git a/Recipe b/Recipe index 68726a02..379f9b6b 100644 --- a/Recipe +++ b/Recipe @@ -330,10 +330,10 @@ puttyapp : [XT] GTKTERM uxmisc misc ldisc settings uxsel U_BE_ALL uxstore + xpmpucfg gtkapp osxlaunch : [UT] osxlaunch -fuzzterm : [UT] UXTERM CHARSET misc uxmisc uxucs fuzzterm time settings +fuzzterm : [UT] UXTERM CHARSET misc version uxmisc uxucs fuzzterm time settings + uxstore be_none -testbn : [UT] testbn sshbn misc conf tree234 uxmisc -testbn : [C] testbn sshbn misc conf tree234 winmisc LIBS +testbn : [UT] testbn sshbn misc version conf tree234 uxmisc +testbn : [C] testbn sshbn misc version conf tree234 winmisc LIBS # ---------------------------------------------------------------------- # On Windows, provide a means of removing local test binaries that we diff --git a/misc.c b/misc.c index 06baf8d6..ed6290f5 100644 --- a/misc.c +++ b/misc.c @@ -1151,6 +1151,7 @@ int strendswith(const char *s, const char *t) char *buildinfo(const char *newline) { strbuf *buf = strbuf_new(); + extern const char commitid[]; /* in commitid.c */ strbuf_catf(buf, "Build platform: %d-bit %s", (int)(CHAR_BIT * sizeof(void *)), @@ -1207,5 +1208,7 @@ char *buildinfo(const char *newline) strbuf_catf(buf, "%sBuild option: DEBUG", newline); #endif + strbuf_catf(buf, "%sSource commit: %s", newline, commitid); + return strbuf_to_str(buf); } diff --git a/version.c b/version.c index 9c94b622..231c1a75 100644 --- a/version.c +++ b/version.c @@ -12,6 +12,7 @@ const char ver[] = TEXTVER; const char sshver[] = SSHVER; +const char commitid[] = SOURCE_COMMIT; /* * SSH local version string MUST be under 40 characters. Here's a diff --git a/version.h b/version.h index b4f91c19..a9fab692 100644 --- a/version.h +++ b/version.h @@ -11,3 +11,4 @@ #define TEXTVER "Unidentified build" #define SSHVER "PuTTY-Unidentified-Local-Build" #define BINARY_VERSION 0,0,0,0 +#define SOURCE_COMMIT "unavailable"