diff -Nru ubuntu-meta-1.501/debian/changelog ubuntu-meta-1.502/debian/changelog --- ubuntu-meta-1.501/debian/changelog 2023-04-01 20:18:52.000000000 +0100 +++ ubuntu-meta-1.502/debian/changelog 2023-04-28 09:09:28.000000000 +0100 @@ -1,3 +1,10 @@ +ubuntu-meta (1.502) mantic; urgency=medium + + * Fix update script to include germinate in 'dependency' check and + refactor script LP: #2017786 + + -- Tim Andersson Fri, 28 Apr 2023 09:09:28 +0100 + ubuntu-meta (1.501) lunar; urgency=medium * Refreshed dependencies diff -Nru ubuntu-meta-1.501/update ubuntu-meta-1.502/update --- ubuntu-meta-1.501/update 2022-01-31 10:38:34.000000000 +0000 +++ ubuntu-meta-1.502/update 2023-04-28 09:06:12.000000000 +0100 @@ -1,13 +1,29 @@ #! /bin/sh -if ! which dch >/dev/null; then - echo >&2 "please install devscripts" - exit 1 -fi -if ! which debootstrap >/dev/null; then - echo >&2 "please install debootstrap" - exit 1 -fi +check_package_installed_and_version() +{ + PACKAGE="${1}" + if ! dpkg -l "${PACKAGE}" >/dev/null; then + echo >&2 "please install ${PACKAGE}" + exit 1 + fi + if ls ./"${PACKAGE}"-version >/dev/null 2>&1; then + VERSION_SPECIFIED=$(cat "${PACKAGE}-version" | cut -d' ' -f2) + VERSION_INSTALLED=$("${PACKAGE}" --version | cut -d' ' -f2) + if ! dpkg --compare-versions "${VERSION_INSTALLED}" gt "${VERSION_SPECIFIED}" >/dev/null; then + echo >&2 "${PACKAGE} version too outdated:" + echo "Version installed: ${VERSION_INSTALLED}" + echo "Version specified: ${VERSION_SPECIFIED}" + echo >&2 "Please install the correct version of ${PACKAGE} to run the update script" + exit 1 + fi + fi +} + + +check_package_installed_and_version debootstrap +check_package_installed_and_version germinate +check_package_installed_and_version devscripts exec germinate-update-metapackage --vcs