From: Daniel Stenberg Date: Sun, 14 May 2017 15:09:45 +0000 (+0200) Subject: curl: show the libcurl release date in --version output X-Git-Tag: curl-7_54_1~115 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=180c75eb63ae95c41c692957ccd13321e44d4e9e;p=thirdparty%2Fcurl.git curl: show the libcurl release date in --version output ... and support and additional "security patched" date for those who enhance older versions that way. Pass on the define CURL_PATCHSTAMP with a date for that. Building with non-release headers shows the date as [unreleased]. Also: this changes the date format generated in the curlver.h file to be "YYYY-MM-DD" (no name of the day or month, no time, no time zone) to make it easier on the eye and easier to parse. Example (new) date string: 2017-05-09 Suggested-by: Brian Childs Closes #1474 --- diff --git a/include/curl/curlver.h b/include/curl/curlver.h index 5d3e160f0e..227571cd30 100644 --- a/include/curl/curlver.h +++ b/include/curl/curlver.h @@ -64,11 +64,11 @@ * timestamp is not stored in git, as the timestamp is properly set in the * tarballs by the maketgz script. * - * The format of the date should follow this template: + * The format of the date follows this template: * - * "Mon Feb 12 11:35:33 UTC 2007" + * "2007-11-23" */ -#define LIBCURL_TIMESTAMP "DEV" +#define LIBCURL_TIMESTAMP "[unreleased]" #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|z) #define CURL_AT_LEAST_VERSION(x,y,z) \ diff --git a/maketgz b/maketgz index 2cc8e13645..a1509819c6 100755 --- a/maketgz +++ b/maketgz @@ -67,8 +67,8 @@ if test -z "$only"; then PLIST="$PLIST$ext" fi -# requires a date command that knows -u for UTC time zone -datestamp=`LC_TIME=C date -u` +# requires a date command that knows + for format +datestamp=`date +"%F"` # Replace version number in header file: sed -i -e 's/^#define LIBCURL_VERSION .*/#define LIBCURL_VERSION "'$libversion'"/g' \ diff --git a/src/tool_help.c b/src/tool_help.c index 668499cca5..46aae45271 100644 --- a/src/tool_help.c +++ b/src/tool_help.c @@ -516,6 +516,12 @@ void tool_version_info(void) const char *const *proto; printf(CURL_ID "%s\n", curl_version()); +#ifdef CURL_PATCHSTAMP + printf("Release-Date: %s, security patched: %s\n", + LIBCURL_TIMESTAMP, CURL_PATCHSTAMP); +#else + printf("Release-Date: %s\n", LIBCURL_TIMESTAMP); +#endif if(curlinfo->protocols) { printf("Protocols: "); for(proto = curlinfo->protocols; *proto; ++proto) {