Use new metadata extracting feature in snaps

This patch replaces the deprecated `version-script` key with new
Snapcraft metadata extracting features based on the `adopt-info` and
`parse-info` keys and the `snapcraftctl set-version` command.

This allows metadata sharing with Setuptools setup.py file.

Refernce:

    Extracting information from sources in snapcraft parts - doc - snapcraft.io
    https://forum.snapcraft.io/t/extracting-information-from-sources-in-snapcraft-parts/4642

Signed-off-by: 林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>
This commit is contained in:
林博仁(Buo-ren Lin) 2019-01-26 05:49:14 +08:00
parent 044fd14137
commit f541e9215b

View File

@ -1,6 +1,5 @@
name: glances
version: set-by-version-script
version-script: git describe --always --dirty --tags --match 'v*' | sed s/^v//
adopt-info: glances
summary: Glances an Eye on your system. A top/htop alternative.
description: |
Glances is a cross-platform monitoring tool which aims to present
@ -32,6 +31,15 @@ parts:
glances:
plugin: python
source: .
# FIXME: Theoretically this also replaces `summary` and `description`
# keys, however due to the following bug we still need to keep
# them until it is fixed.
# https://bugs.launchpad.net/snapcraft/+bug/1813364
parse-info: [setup.py]
override-pull: |
snapcraftctl pull
snapcraftctl set-version \
"$(git describe --always --dirty --tags --match 'v*' | sed s/^v//)"
bottle:
plugin: python
source: https://github.com/bottlepy/bottle.git