summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2014-12-01 21:34:54 +0000
committerTails developers <amnesia@boum.org>2014-12-01 21:36:21 +0000
commit71ef323039849fe356aff43cb62b1917ae5d6947 (patch)
tree60da9cb7bfc1204e66c61d6845146d3ee3e5acdf
parent97e152bfe1d4c9d6e05920efd4f43804cc3eb1b8 (diff)
Make check_po.sh exit with 0 iff. the filtered i18nspector's output was empty.
It'll allow easier integration within our CI thingies. This change has the drawback that we're buffering output, and displaying it only once all i18nspector processes have completed. I say it's acceptable, now that their accumulated runtime is quite low. There might be a way to do this better, with some trick to capture stdout without buffering it.
-rwxr-xr-xwiki/src/contribute/l10n_tricks/check_po.sh17
1 files changed, 10 insertions, 7 deletions
diff --git a/wiki/src/contribute/l10n_tricks/check_po.sh b/wiki/src/contribute/l10n_tricks/check_po.sh
index ff9ff2b..6866291 100755
--- a/wiki/src/contribute/l10n_tricks/check_po.sh
+++ b/wiki/src/contribute/l10n_tricks/check_po.sh
@@ -41,10 +41,13 @@ else
FILE_GLOB="*.po"
fi
-find -iname "$FILE_GLOB" -print0 \
- | xargs -0 \
- --max-procs=$(egrep '^processor[[:space:]]+:' /proc/cpuinfo | wc -l) \
- --max-args=64 \
- i18nspector \
- | grep -v --line-regexp '' \
- | grep -v -f $PATTERNS_FILE
+CPUS=$(egrep '^processor[[:space:]]+:' /proc/cpuinfo | wc -l)
+OUTPUT=$(find -iname "$FILE_GLOB" -print0 \
+ | xargs -0 --max-procs="$CPUS" --max-args=64 i18nspector \
+ | grep -v --line-regexp '' \
+ | grep -v -f $PATTERNS_FILE)
+
+echo $OUTPUT
+
+# Exit code: 0 iff. the filtered i18nspector's output was empty
+[ $(echo "$OUTPUT" | wc -l) -eq 0 ]