From 73fbfa7ed205c36178f95b983e1c7eea175420af Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Sun, 10 May 2020 16:54:54 +0200 Subject: debian: build.sh: add version sanity check Creating the Debian packages will fail if the version does not match, so check it first. Signed-off-by: Michael Olbrich --- debian/bin/build.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/bin/build.sh b/debian/bin/build.sh index 51a7914..c8a72f7 100755 --- a/debian/bin/build.sh +++ b/debian/bin/build.sh @@ -14,6 +14,14 @@ else exit 1 fi +cfgs=( ptxconfigs/*.ptxconfig ) +PTX_VERSION=$(sed -n -e 's/^PTXCONF_PROJECT="OSELAS.Toolchain-\(.*\)"$/\1/p' ${cfgs[0]}) +DEBIAN_VERSION="$(sed -n '1s/.*(\([^-]*\)-.*).*/\1/p' debian/changelog)" +if [ "${PTX_VERSION}" != "${DEBIAN_VERSION}" ]; then + echo "release version from the debian/changelog (${DEBIAN_VERSION}) does not match '${PTX_VERSION}'" + exit 1 +fi + if ! [[ "${VERSION}" =~ .*/sid ]]; then git checkout debian/changelog dch --local ${PREFIX}${VERSION}+ --distribution ${RELEASE} "Rebuild for ${RELEASE}" || exit -- cgit v1.2.3