From eb977b8021a997abdb973483ec68ca46ff195e13 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Tue, 17 Oct 2017 14:36:18 +0200 Subject: [PATCH] Check AppStream info file before merging releases --- release-tool | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/release-tool b/release-tool index 35163069..c3fa84d3 100755 --- a/release-tool +++ b/release-tool @@ -257,7 +257,30 @@ checkChangeLog() { grep -qPzo "${RELEASE_NAME} \(\d{4}-\d{2}-\d{2}\)\n=+\n" CHANGELOG if [ $? -ne 0 ]; then - exitError "CHANGELOG does not contain any information about the '${RELEASE_NAME}' release!" + exitError "'CHANGELOG' has not been updated to the '${RELEASE_NAME}' release!" + fi +} + +checkAppStreamInfo() { + if [ ! -f share/linux/org.keepassxc.appdata.xml ]; then + exitError "No AppStream info file found!" + fi + + grep -qPzo "" share/linux/org.keepassxc.appdata.xml + if [ $? -ne 0 ]; then + exitError "'share/linux/org.keepassxc.appdata.xml' has not been updated to the '${RELEASE_NAME}' release!" + fi +} + +checkSnapcraft() { + if [ ! -f snapcraft.yaml ]; then + echo "No snapcraft file found!" + return + fi + + grep -qPzo "version: ${RELEASE_NAME}" snapcraft.yaml + if [ $? -ne 0 ]; then + exitError "'snapcraft.yaml' has not been updated to the '${RELEASE_NAME}' release!" fi } @@ -273,18 +296,6 @@ checkTransifexCommandExists() { fi } -checkSnapcraft() { - if [ ! -f snapcraft.yaml ]; then - echo "No snapcraft file found!" - return - fi - - grep -qPzo "version: ${RELEASE_NAME}" snapcraft.yaml - if [ $? -ne 0 ]; then - exitError "snapcraft.yaml has not been updated to the '${RELEASE_NAME}' release!" - fi -} - performChecks() { logInfo "Performing basic checks..." @@ -309,6 +320,7 @@ performChecks() { checkVersionInCMake checkChangeLog + checkAppStreamInfo checkSnapcraft logInfo "\e[1m\e[32mAll checks passed!\e[0m"