Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: fix version script #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented May 5, 2023

This mirrors the fix in #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!

This mirrors the fix in canonical#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!
Copy link
Member

@Meulengracht Meulengracht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

Copy link
Member

@alfonsosanchezbeato alfonsosanchezbeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants