From f541e9215bc63156c61505a4bafc2a13ddafd23e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E5=8D=9A=E4=BB=81=28Buo-ren=20Lin=29?= Date: Sat, 26 Jan 2019 05:49:14 +0800 Subject: [PATCH] Use new metadata extracting feature in snaps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- snap/snapcraft.yaml | 12 ++++++++++-- 1 file 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