]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Check the release date when archiving the project
authorFrederic Marchal <fmarchal@users.sourceforge.net>
Sun, 21 Sep 2014 13:24:39 +0000 (15:24 +0200)
committerFrederic Marchal <fmarchal@users.sourceforge.net>
Sun, 21 Sep 2014 13:24:39 +0000 (15:24 +0200)
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

index f91bdee58bb3107306a85d62fe6be0bc9ce0e7f5..a5563dd50bdf61aa3f64e005829f93f51a0c9304 100755 (executable)
@@ -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"