From c95b6ec19d14c82b955842e2e3f552e32ed271b0 Mon Sep 17 00:00:00 2001 From: Denis Rouzaud Date: Mon, 22 Jul 2024 09:09:54 +0200 Subject: [PATCH] fix version2 check --- scripts/check_version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check_version.sh b/scripts/check_version.sh index 2743886..eaa42e1 100755 --- a/scripts/check_version.sh +++ b/scripts/check_version.sh @@ -1,14 +1,14 @@ #!/usr/bin/env bash VERSION_CHECK=$1 -VERSION_INSTALLED=$(apt-cache show qgis | grep Version | cut -d' ' -f2 | cut -d. -f1,2 ) +VERSION_INSTALLED=$(apt list --installed qgis | grep installed | cut -d: -f2 | cut -d\+ -f1) if [[ ${VERSION_CHECK} == 'master' ]]; then echo "installed: ${VERSION_INSTALLED}" exit 0 fi -if [[ ${VERSION_CHECK} == ${VERSION_INSTALLED} ]]; then +if [[ ${VERSION_INSTALLED} =~ ^${VERSION_CHECK}\.[0-9]+ ]]; then echo "version check ok: ${VERSION_INSTALLED}" exit 0 fi