From 95877db01d30e9b84e357d2d73ff859bcd737576 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Fri, 29 Sep 2023 13:37:18 +0200 Subject: [PATCH] fixed check updates availibillity --- autobuild.sh | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/autobuild.sh b/autobuild.sh index 535c2fc..1134f9d 100755 --- a/autobuild.sh +++ b/autobuild.sh @@ -19,16 +19,13 @@ if [[ "$CURRENT_TUMBLEWEED_TAG" == "$LATEST_TUMBLEWEED_TAG" ]]; then fi echo "New tumbleweed image exists" -CURRENT_VERSION="$(podman run --rm -it ${TARGET_REPO}${PACKAGE_NAME}:latest /usr/bin/bash -c "zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")" -LATEST_VERSION="$(podman run --rm -it ${BASE_IMAGE}:latest /usr/bin/bash -c "zypper ref > /dev/null && zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")" - -echo "current : $CURRENT_VERSION" -echo "latest : $LATEST_VERSION" - -if [[ "$CURRENT_VERSION" == "$LATEST_VERSION" ]]; then - echo "No new $PACKAGE_NAME version detected" +if [[ "x" == "x$(podman run --rm -it ${TARGET_REPO}${PACKAGE_NAME}:latest /usr/bin/bash -c "zypper list-updates | grep $PACKAGE_NAME")" ]]; then + echo "No updates for $PACKAGE_NAME" exit 0 fi +LATEST_VERSION="$(podman run --rm -it ${BASE_IMAGE}:latest /usr/bin/bash -c "zypper ref > /dev/null && zypper info $PACKAGE_NAME | sed -n 's/.*Version : \(.*\)$/\1/p'")" + +echo "updates found : $LATEST_VERSION" #Updateing Makefile with latest image tag sed -i 's/VERSION='"$CURRENT_TUMBLEWEED_TAG"'/VERSION='"$LATEST_TUMBLEWEED_TAG"'/' Makefile