diff --git a/.github/workflows/tests-01-main.yml b/.github/workflows/tests-01-main.yml index 723fb1dd8..e267add53 100644 --- a/.github/workflows/tests-01-main.yml +++ b/.github/workflows/tests-01-main.yml @@ -51,7 +51,16 @@ jobs: echo "Failed to detect ${APP} as installed" >&2 exit 1 else - ./deb-get purge "${APP}" + PUBLISHED_VER=$(./deb-get show "${APP}" | grep "Published:" | grep -oE '[^[:space:]]+$' || :) + INSTALLED_VER=$(dpkg-query -Wf '${Version}' "${APP}" || :) + if [ -n "${PUBLISHED_VER// /}" ] && dpkg --compare-versions "${PUBLISHED_VER}" gt "${INSTALLED_VER}" ; then + echo "Versions do not match. The package's VERSION_PUBLISHED variable may need to be changed." >&2 + echo "Published Version: ${PUBLISHED_VER}" + echo "Installed Version: ${INSTALLED_VER}" + exit 1 + else + ./deb-get purge "${APP}" + fi fi fi done