From c6ff23fc9aa8596486af19cbbb933811ad9fa4e2 Mon Sep 17 00:00:00 2001 From: Gambhiro Date: Fri, 18 Dec 2015 17:43:37 +0000 Subject: [PATCH] check that version numbers agree --- package-linux.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/package-linux.sh b/package-linux.sh index 4451427..a72ed72 100755 --- a/package-linux.sh +++ b/package-linux.sh @@ -17,7 +17,26 @@ Options: --unsigned" PROJECT=fractorium -VERSION=$(cat ./debian/changelog | head -n 1 | sed 's/^'$PROJECT' (\([^-]\+\)-.*/\1/') + +changelogVersion=$(cat ./debian/changelog | head -n 1 | sed 's/^'$PROJECT' (\([^-]\+\)-.*/\1/') +emberVersion=$(grep '#define EMBER_VERSION' ./Source/Ember/EmberDefines.h | sed 's/^.*EMBER_VERSION "\([^"]\+\)".*/\1/') + +a=$(echo -n "$changelogVersion" | sed 's/[a-z]//g') +b=$(echo -n "$emberVersion" | sed 's/[a-z]//g') + +if [[ "$a" != "$b" ]]; then + echo "Error: Different version numbers were found. Please update the correct file, +the version numbers should agree up to the digits in: + +$changelogVersion +$emberVersion + +./debian/changelog : $a +./Source/Ember/EmberDefines.h : $b" + exit 2 +fi + +VERSION=$changelogVersion PROJECT_ROOT=$PWD PPA_DIR="$HOME/PPA/$PROJECT-$VERSION" TAR_NAME="$PROJECT-$VERSION.tar.gz"