From: Frederic Marchal Date: Sun, 21 Sep 2014 13:37:26 +0000 (+0200) Subject: Archive script with better error messages X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d75b03b64dc29b5d4e8b3967e323d0614359082e;p=thirdparty%2Fsarg.git Archive script with better error messages When the version number isn't correct, the error message gives a clearer indication about what is wrong. Conflicts: archive.sh --- diff --git a/archive.sh b/archive.sh index 6e3b582..29c84b2 100755 --- a/archive.sh +++ b/archive.sh @@ -6,17 +6,21 @@ Target=".." # check version number in every file Version=$(cat "$Sources/CMakeLists.txt" | sed -n -e 's/^SET(sarg_VERSION \([0-9]\))/\1/p') if [ -z "$Version" ] ; then - echo "No version found" + echo "No version found in CMakeLists.txt" exit 1 fi Revision=$(cat "$Sources/CMakeLists.txt" | sed -n -e 's/^SET(sarg_REVISION "\([0-9][0-9]*.*\)")/\1/p') if [ -z "$Revision" ] ; then - echo "No revision found" + echo "No revision found in CMakeLists.txt" exit 1 fi Version="$Version.$Revision" VersionCheck=$(sed -n -e 's/^AC_INIT(\[sarg\],\[\([0-9][0-9]*\.[0-9][0-9]*.*\)\])/\1/p' "$Sources/configure.in") +if [ -z "$VersionCheck" ] ; then + echo "No version found in configure.in" + exit 1 +fi if [ "x$Version" != "x$VersionCheck" ] ; then echo "CMakeLists and configure doesn't refer to the same version" exit 1