From 8d54348bb9bb3c1a7aaa3b187dc073fdfd8efcf9 Mon Sep 17 00:00:00 2001 From: Frederic Marchal Date: Sun, 21 Sep 2014 15:24:39 +0200 Subject: [PATCH] Check the release date when archiving the project The release date is in the cmake script and in the source code. The script to package sarg now check that the two dates are identical. --- archive.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/archive.sh b/archive.sh index f91bdee..a5563dd 100755 --- a/archive.sh +++ b/archive.sh @@ -26,6 +26,23 @@ if [ "x$Version" != "x$VersionCheck" ] ; then exit 1 fi +# Check release date +ReleaseDate=$(cat "$Sources/CMakeLists.txt" | sed -n -e 's/^SET(sarg_BUILDDATE "\([A-Z][a-z][a-z]-[0-3][0-9]-2[0-1][0-9][0-9]\)")/\1/p') +if [ -z "$ReleaseDate" ] ; then + echo "No release date found or release date is invalide in CMakeLists.txt" + exit 1 +fi + +ReleaseDateCheck=$(cat "$Sources/include/info.h" | sed -n -e 's/^#define VERSION PACKAGE_VERSION" \([A-Z][a-z][a-z]-[0-3][0-9]-2[0-1][0-9][0-9]\)"/\1/p') +if [ -z "$ReleaseDateCheck" ] ; then + echo "No release date found or release date is invalide in include/info.h" + exit 1 +fi +if [ "x$ReleaseDate" != "x$ReleaseDateCheck" ] ; then + echo "CMakeLists and include/info.h doesn't refer to the same release date" + exit 1 +fi + # update the po files if ( ! make update-po ) ; then echo "Failed to update the po files" -- 2.47.2