[linux-snap][Xenial][Bionic][PATCH 1/1] Fix version matching for signed re-uploads

Kleber Sacilotto de Souza kleber.souza at canonical.com
Fri Feb 7 15:32:28 UTC 2020


When a signed package needs to be re-uploaded keeping the same ABI
number, a '+signedN' suffix is added to its version number. This is
causing problems for the snap build which detects a mismatch with the
version requested by the snapcraft.yaml file. Fix it by considering
any '+*' suffix as valid suffix when performing the match with the
installed linux image package.

Signed-off-by: Kleber Sacilotto de Souza <kleber.souza at canonical.com>
---
 Makefile | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 0b1de06..cb94949 100644
--- a/Makefile
+++ b/Makefile
@@ -194,8 +194,9 @@ versioncheck:
 	KIMGVER="$$(dpkg --root=chroot -l | awk '/$(KIMGDEB)/ {print $$3}')"; \
 	echo $$KIMGVER; \
 	[ ! $$KIMGVER ] && echo "Unable to extract KIMGVER, exit" && exit 1; \
-	if [ $$KIMGVER != $(SNAPCRAFT_PROJECT_VERSION) ]; then \
-	  echo "Version mismatch:\nInstalled: $$KIMGVER Requested: $(SNAPCRAFT_PROJECT_VERSION)"; \
-	  exit 1; \
-	fi; \
+	case "$$KIMGVER" in \
+	$(SNAPCRAFT_PROJECT_VERSION)|$(SNAPCRAFT_PROJECT_VERSION)+*) ;; \
+	*)  echo "Version mismatch:\nInstalled: $$KIMGVER Requested: $(SNAPCRAFT_PROJECT_VERSION)"; \
+	    exit 1; \
+	esac; \
 	}
-- 
2.20.1




More information about the kernel-team mailing list