summaryrefslogtreecommitdiffstats
path: root/snap
diff options
context:
space:
mode:
author林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>2019-01-26 05:49:14 +0800
committer林博仁(Buo-ren Lin) <Buo.Ren.Lin@gmail.com>2019-01-26 06:04:44 +0800
commitf541e9215bc63156c61505a4bafc2a13ddafd23e (patch)
treef8b48a013d77664194acd8f32a3d4067442e8ff1 /snap
parent044fd1413710143c9b714fe3b20db7ea95e5eb27 (diff)
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>
Diffstat (limited to 'snap')
-rw-r--r--snap/snapcraft.yaml12
1 files changed, 10 insertions, 2 deletions
diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
index 7d0f618a..82624e6c 100644
--- a/snap/snapcraft.yaml
+++ b/snap/snapcraft.yaml
@@ -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