From c0fcb67c3126d6327d35a9196c1cf25d1f0e11ab Mon Sep 17 00:00:00 2001 From: Steffen Nurpmeso Date: Mon, 4 Dec 2017 22:10:02 +0100 Subject: [PATCH] Introduce *version-hexnum* --- gen-version.h | 1 + make-config.in | 3 +++ nail.1 | 15 ++++++++++----- nail.h | 7 ++++--- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/gen-version.h b/gen-version.h index 03808d07..c996b625 100644 --- a/gen-version.h +++ b/gen-version.h @@ -3,3 +3,4 @@ #define n_VERSION_MAJOR "14" #define n_VERSION_MINOR "9" #define n_VERSION_UPDATE "5" +#define n_VERSION_HEXNUM "0x0E009005" diff --git a/make-config.in b/make-config.in index e39143eb..1bb0f546 100644 --- a/make-config.in +++ b/make-config.in @@ -287,6 +287,9 @@ _update-version: printf >> ./version.tmp "#define n_VERSION_MAJOR \"$${vmaj}\"\n";\ printf >> ./version.tmp "#define n_VERSION_MINOR \"$${vmin}\"\n";\ printf >> ./version.tmp "#define n_VERSION_UPDATE \"$${vupd}\"\n";\ + printf >> ./version.tmp \ + "#define n_VERSION_HEXNUM \"0x%02X%03X%03X\"\n" \ + "$${vmaj}" "$${vmin}" "$${vupd}";\ $(cmp) ./version.tmp ./gen-version.h >/dev/null 2>&1 && exit;\ $(mv) ./version.tmp ./gen-version.h;\ trap : 0 1 2 15 diff --git a/nail.1 b/nail.1 index bc04b2f7..172a71de 100644 --- a/nail.1 +++ b/nail.1 @@ -11998,11 +11998,16 @@ is sufficient to disable verbosity as such. .Mx .Mx .Mx -.It Va version , version-date , version-major , version-minor , version-update -\*(RO \*(UA version information: the first variable contains a string -containing the complete version identification, the latter three contain -only digits: the major, minor and update version numbers. -The date is in ISO 8601 notation. +.It Va version , version-date , \ + version-hexnum , version-major , version-minor , version-update +\*(RO \*(UA version information: the first variable is a string with +the complete version identification, the second the release date in ISO +8601 notation without time. +The third is a 32-bit hexadecimal number with the upper 8 bits storing +the major, followed by the minor and update version numbers which occupy +12 bits each. +The latter three variables contain only decimal digits: the major, minor +and update version numbers. The output of the command .Ic version will include this information. diff --git a/nail.h b/nail.h index 6221bee2..1022c899 100644 --- a/nail.h +++ b/nail.h @@ -1796,9 +1796,10 @@ ok_v_ssl_protocol, /* {chain=1} */ ok_b_verbose, /* {vip=1} */ ok_v_version, /* {virt=n_VERSION} */ ok_v_version_date, /* {virt=n_VERSION_DATE} */ - ok_v_version_major, /* {virt=n_VERSION_MAJOR} */ - ok_v_version_minor, /* {virt=n_VERSION_MINOR} */ - ok_v_version_update, /* {virt=n_VERSION_UPDATE} */ + ok_v_version_hexnum, /* {virt=n_VERSION_HEXNUM,posnum=1} */ + ok_v_version_major, /* {virt=n_VERSION_MAJOR,posnum=1} */ + ok_v_version_minor, /* {virt=n_VERSION_MINOR,posnum=1} */ + ok_v_version_update, /* {virt=n_VERSION_UPDATE,posnum=1} */ ok_b_writebackedited -- 2.11.4.GIT