summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2020-05-10 16:54:54 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2020-05-11 07:41:37 +0200
commit73fbfa7ed205c36178f95b983e1c7eea175420af (patch)
tree1c3c153a9063cdeb9bdb7044d750f36dd9cbeb10
parent592e020473b24f845df6002f082e7697c49c799c (diff)
downloadOSELAS.Toolchain-73fbfa7ed205c36178f95b983e1c7eea175420af.tar.gz
debian: build.sh: add version sanity checkHEADmaster
Creating the Debian packages will fail if the version does not match, so check it first. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-xdebian/bin/build.sh8
1 files changed, 8 insertions, 0 deletions
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