'Latest version' in 'bk version' output

From an email today:

Subject: bk 7.2.1ce version says the latest version is bk-7.2ce

$ bk version
BitKeeper version is bk-7.2.1ce 20160516185205 for x86_64-glibc219-linux
Built by: wscott@debian80-64.bitkeeper.com in /build/bk-7.2.1-wscott/src
Built on: Mon May 16 2016 15:03:36 EDT (65 hours ago)
Running on: x86_64-glibc219-linux,3.16.0-4-amd64
Latest version: bk-7.2ce  (released 11 days ago)

Just thought you ought to know.

In the commercial versions of BitKeeper, the latest released version was sent along with the lease from our license server. With the open-source release, the code has to actually poll our download area on bitkeeper.org to find the latest release.

This is done in upgrade.c:upgrade_latestVersion() and is done as a background process that is spawned at most once a day and writes the results to $HOME/.bk/latest-bkver. As a result, sometimes the data can be stale, and even running ‘bk version’ twice in a row and return 2 different answers as the first one will start a refresh and only the second call will new the new answer.

In this particular case, I know the author of this email often runs his machines completely firewalled off from the Internet so the background refreshes will fail and the data becomes stale.

BTW if a new version is available then:

sudo bk upgrade

is usually at that is needed to install that version on the current machine. It downloads the current installer image and uses it to upgrade the bk that is only your PATH.

But perhaps he is right. If the timestamp of the current binary is newer than the latest version, (I do actually have that info) then I should just skip printing that ‘Latest version’ line because it probably isn’t correct.

I don’t think about that personally because the versions I run are almost ALWAYS newer than the release. :wink: