From 9f52dbb42cbf004b86a299df88ede02d6905ad54 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Sat, 12 Jul 2014 09:12:33 +0200 Subject: [PATCH] Fix propose_translation runs The propose_translation runs use "#!/bin/bash -xe" - thus exit when an error occurs. It's ok for the grep in filter_commit to not found anything, thus ignore exit results. Otherwise the script will exit with error code which is not the intented behaviour. This unbreaks all propose_translation jobs. My tests were done without "set -e" in the environment ;( Change-Id: I8fff0bc42b45b356dd1ca3ab9b2586628ff59a57 --- .../files/slave_scripts/common_translation_update.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/openstack_project/files/slave_scripts/common_translation_update.sh b/modules/openstack_project/files/slave_scripts/common_translation_update.sh index bb5f3d8905..f8705b83e8 100644 --- a/modules/openstack_project/files/slave_scripts/common_translation_update.sh +++ b/modules/openstack_project/files/slave_scripts/common_translation_update.sh @@ -269,9 +269,12 @@ function filter_commits () # comment lines, or diff file information. for f in `git diff --cached --name-only` do + # It's ok if the grep fails + set +e changed=$(git diff --cached "$f" \ | egrep -v "(POT-Creation-Date|Project-Id-Version|PO-Revision-Date)" \ | egrep -c "^([-+][^-+#])") + set -e if [ $changed -eq 0 ] then git reset -q "$f"