From e601cc96e858237ac39c51de218782d93d68ca62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfonso=20S=C3=A1nchez-Beato?= Date: Thu, 8 May 2025 15:47:19 +0200 Subject: [PATCH] Fix snap version We are now getting some package versions like 2.61.4ubuntu0.16.04.1+esm1, make sure that we cut them starting at "ubuntu". --- Makefile | 2 +- snapcraft.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fad46b1..28324d5 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ install: $(SUDO) mv binary/boot/filesystem.dir/* $(DESTDIR)/ # only copy the manifest file if we are in a launchpad buildd set -e ; if [ -e /build/core ]; then \ - TARGET_BASENAME=/build/core/core_16-$$(cat $(DESTDIR)/usr/lib/snapd/info|cut -f2 -d=|cut -f1 -d~|cut -b1-29)_$(DPKG_ARCH)-$$(/bin/date +%Y%m%d); \ + TARGET_BASENAME=/build/core/core_16-$$(grep ^VERSION= $(DESTDIR)/usr/lib/snapd/info | cut -f2 -d= | sed 's/~\?ubuntu.*//' | cut -b1-29)_$(DPKG_ARCH)-$$(/bin/date +%Y%m%d); \ $(SUDO) mv livecd.ubuntu-core.manifest "$${TARGET_BASENAME}".manifest; \ $(SUDO) cp /build/core/parts/livebuild/install/usr/share/snappy/dpkg.yaml "$${TARGET_BASENAME}".dpkg.yaml; \ ls -lah /build/core; \ diff --git a/snapcraft.yaml b/snapcraft.yaml index b9f4182..63e1ba0 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -2,7 +2,7 @@ name: core version: 16-2 version-script: | # remember to keep version script in sync with "Makefile" - echo "16-$(grep ^VERSION= prime/usr/lib/snapd/info |cut -f2 -d=| sed s/~ubuntu.*// | cut -b1-29)-$(/bin/date +%Y%m%d)" + echo "16-$(grep ^VERSION= prime/usr/lib/snapd/info | cut -f2 -d= | sed 's/~\?ubuntu.*//' | cut -b1-29)-$(/bin/date +%Y%m%d)" summary: snapd runtime environment description: The core runtime environment for snapd confinement: strict