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