snapcraft: override-pull of curtin to inject the git commit hash into version string

This commit is contained in:
Ryan Harper 2020-04-21 11:27:16 -05:00
parent 140cdacada
commit 7f301dbe7c
1 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,10 @@ apps:
parts:
curtin:
override-pull: |
snapcraftctl pull
PACKAGED_VERSION="$(git describe --long --abbrev=9 --match=[0-9][0-9]*)"
sed -e "s,@@PACKAGED_VERSION@@,$PACKAGED_VERSION,g" -i curtin/version.py
plugin: python
source-type: git
source: git://git.launchpad.net/curtin