Core version string

We recently landed support to adding better version information to the core snap.

The previous version of the core snap was 16-2. With the new version support we can put a more meaningful version derived from from the “upstream” version of snapd. The only caveat is that the total version is max. 32 chars long. For releases of snapd this works great, e.g. 16-2.26.1.

We just need to decide what to encode in the development version of snapd. Some options:

16-2.26.1+201705151555
16-2.26.1+201705151555.git.d15bf
16-2.26.1+201705151555.g24f8ca6
16-2.26.1+g24f8ca6c1
16-2.26.1+git.115                # 115 commits since the last tag

More ideas welcome.

Fwiw, we should fix this directly in the build recipe in https://code.launchpad.net/~snappy-dev/+recipe/snapd-vendor-daily if we can. The caveat for the build recipe version is that it must follow the dpkg version ordering. But even if we decide to use a different version string that is not dpkg sortable we can fixup things in https://github.com/snapcore/core/blob/master/snapcraft.yaml

iirc we originally discussed
16-2.26.1+20170515.git.xxxxxx

at least that is what my notes say here (since i was working on this initially (though waiting for teh snapcraft support for it that would have avoided any script snippets)

Thanks, this format provides no dpkg version comparable versions, but thats fine, if we just use if for the version info string. Will wait for confirmation. It just means a bit more cut/sed in the version-script in snapcraft.yaml.

well, once the env var feature is finished (the thing i was waiting for) in snapcraft, we should only need to export the value in the Makefile and be done, there wont be any version script needed (i’ll send PRs once it is there, it should simplify the whole thing)