From afa290ecfb2ad87f39006557f756754a02741c5a Mon Sep 17 00:00:00 2001 From: Oneric Date: Sat, 29 Apr 2023 01:23:16 +0200 Subject: [PATCH] po/make_pot: don't silently omit strings if utilities are missing Instead abort the script on any errors, which also helps detecting other unexpected errors. Adopts parts of: https://github.com/wangqr/Aegisub/commit/940181c7bc76128a008c15292d9a5dc0cb8c2281 and https://github.com/wangqr/Aegisub/commit/4aee271d034f5f0a47863594f07ef4d172ecc4f4 --- po/make_pot.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/po/make_pot.sh b/po/make_pot.sh index 04e273168..f18ac1167 100755 --- a/po/make_pot.sh +++ b/po/make_pot.sh @@ -1,4 +1,5 @@ #!/bin/sh +set -e maybe_append() { while read -r msg; do @@ -48,11 +49,9 @@ do | maybe_append done -if which xmlstarlet >/dev/null 2>&1 && which jq >/dev/null 2>&1; then - for i in 'name' 'summary' 'p' 'li' 'caption'; do - xmlstarlet sel -t -v "//$i" ../packages/desktop/aegisub.appdata.xml.in.in | jq -R . - done | nl -v0 -w1 -s'|' | sed -re 's/^/aegisub.appdata.xml|/' | maybe_append -fi +for i in 'name' 'summary' 'p' 'li' 'caption'; do + xmlstarlet sel -t -v "//$i" ../packages/desktop/aegisub.appdata.xml.in.in | jq -R . +done | nl -v0 -w1 -s'|' | sed -re 's/^/aegisub.appdata.xml|/' | maybe_append grep '^_[A-Za-z0-9]*=.*' ../packages/win_installer/fragment_strings.iss.in | while read line do