From: Frederic Marchal Date: Sun, 21 Sep 2014 13:23:21 +0000 (+0200) Subject: Archive script with better error messages X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fdeee8dcdcc923b48d834c6b994d6cd9b0fa85d0;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. --- diff --git a/archive.sh b/archive.sh index 9a8da29..f91bdee 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=$(cat "$Sources/configure.in" | sed -n -e 's/^AC_INIT(\[sarg\],\[\([0-9][0-9]*\.[0-9][0-9]*.*\)\])/\1/p') +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