core icon indicating copy to clipboard operation
core copied to clipboard

Makefile: fix version script

Open mvo5 opened this issue 2 years ago • 0 comments

This mirrors the fix in https://github.com/snapcore/core/pull/127 but for the target filename instead of for the version scriptlet.

The current usr/lib/snapd/info looks like this:

VERSION=2.59.3
SNAPD_APPARMOR_REEXEC=1
SNAPD_ASSERTS_FORMATS='{"snap-declaration":5,"system-user":2}'

which means that the previous version of the code would extract a version number like:

$ cat usr/lib/snapd/info|cut -f2 -d=|cut -f1 -d~|cut -b1-29
2.59.3
1
'{"snap-declaration":5,"syste

Using grep to just find the right lines fixes this.

This was observed in recent uploads of core, e.g. in https://launchpad.net/~snappy-dev/+snap/core-beta/+build/2098563

Thanks to Colin and Dimitri for their help with this!

mvo5 avatar May 05 '23 08:05 mvo5