]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Make bob builds show the full source git commit hash in buildinfo.
authorSimon Tatham <anakin@pobox.com>
Sat, 21 Jan 2017 14:55:53 +0000 (14:55 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 21 Jan 2017 14:55:53 +0000 (14:55 +0000)
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.

Buildscr
Recipe
misc.c
version.c
version.h

index a476ff75c31774492f11021fe20cd18eb3210565..ba55429feddb92b4da7370fbeb90b5fa2c784e6a 100644 (file)
--- 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 68726a02f32e76b77c8e528a63b6913d05a8e68f..379f9b6b7fe9173bebaa4014663a907be5d4e857 100644 (file)
--- 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 06baf8d6fc6304d9b6f95821cb77c50fc3bf4715..ed6290f52eee9eb81af4ea5bbf65021fe039f929 100644 (file)
--- 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);
 }
index 9c94b6225e884f7b4f36c0dfde8b226eecddf2bd..231c1a75b803c1c031980bab8f82b866e8714163 100644 (file)
--- 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
index b4f91c1928d6351c58a5573d65457774d7efbd04..a9fab69248f0ebfec5390097d09ac1a81db70268 100644 (file)
--- 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"