Sources="."
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"
exit 1
fi
+# update the po files
+if ( ! make update-po ) ; then
+ echo "Failed to update the po files"
+ exit 1
+fi
+
+# is the git repository dirty?
+if [[ $(git diff --shortstat 2> /dev/null) != "" ]] ; then
+ echo "Git repository is dirty"
+ exit 1
+fi
+
+# check the working tree
+if ( ! git diff-files --quiet ) ; then
+ echo "Uncommitted changes in working tree"
+ exit 1
+fi
+
+# check the index for uncommitted changes
+if ( ! git diff-index --quiet --cached HEAD ) ; then
+ echo "Uncommitted changes in the index"
+ exit 1
+fi
+
+# check for untracked files
+Untracked="$(git ls-files --exclude-standard --others)"
+if [[ -n "$Untracked" ]] ; then
+ echo "Untracked files in directory"
+ echo "$Untracked"
+ exit 1
+fi
+
+# is the git tag set?
+GitVersion=$(git describe)
+if [[ "$GitVersion" != "$Version" ]] ; then
+ echo "Git tag not set for version $Version. Use command:"
+ echo "git tag -a \"$Version\" -m \"$Version\""
+ exit 1
+fi
+
+# prepare the archive
SargList="$Target/sarglist.txt.unsort"
SortList="$Target/sarglist.txt"
DirList="$Target/sargdir.txt"