Version strings

Richard Laager rlaager at wiktel.com
Tue Jan 9 01:58:21 UTC 2018


On 01/08/2018 03:14 PM, Hal Murray via devel wrote:
>> waf should be putting the version in ntploggps, then it will mean something,
>> and can run standalone

If you need the version number in a Python utility, use something like
this (which I did test) to get the version number:
VERSION='@NTPSEC_VERSION_MAJOR at .@NTPSEC_VERSION_MINOR at .@NTPSEC_VERSION_REV@'

Then use it however you want:
print("My version is {0}.".format(VERSION))

In general, it seems to me that the utilities should have their version
embedded, and when asked for a --version, print both the utility version
and the module version.

> There was similar discussion of waf editing man pages to get the date on the 
> bottom left corner.
Since I already learned a bunch about waf substitutions for the path
embedding thing, this didn't take me long to implement. Here is the
merge request:
https://gitlab.com/NTPsec/ntpsec/merge_requests/643

-- 
Richard


More information about the devel mailing list