From c58a080f4d3ee42fe99ee833e1994d485a03b10f Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 8 Mar 2021 10:01:30 +0100 Subject: [PATCH] Tools: Improve Wininstaller translation checker The checker will now detect if the macros are commented out. https://github.com/jamulussoftware/jamulus/pull/1198#pullrequestreview-605873460 Signed-off-by: Christian Hoffmann --- tools/check-wininstaller-translations.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/check-wininstaller-translations.sh b/tools/check-wininstaller-translations.sh index d3557b2a78..6c8d2375e4 100755 --- a/tools/check-wininstaller-translations.sh +++ b/tools/check-wininstaller-translations.sh @@ -11,7 +11,7 @@ for LANGUAGE_FILE in ${LANGUAGE_FILES}; do echo echo "* ${LANGUAGE_FILE}" echo -n " - Checking language file is included in ${INSTALLERLNG}... " - if grep -qF $(tr '/' '\\' <<<"${LANGUAGE_FILE}") "${BASE_DIR}/${INSTALLERLNG}"; then + if grep -q '^!include "\${ROOT_PATH}\\'$(tr '/' '\\' <<<"${LANGUAGE_FILE}" | sed -re 's|\\|\0\0|g')'"' "${BASE_DIR}/${INSTALLERLNG}"; then echo "ok" else echo "ERROR" @@ -53,7 +53,7 @@ for LANGUAGE_FILE in ${LANGUAGE_FILES}; do echo -n " - Checking if LANG_ macro is in ${INSTALLERLNG}..." LANG_NAME="$(sort -u <<<"${LANG_MACROS}" | sed -rne 's/\$\{LANG_(.*)\}/\1/p')" - if grep -qi '!insertmacro MUI_LANGUAGE "'"${LANG_NAME}"'"' "$BASE_DIR/${INSTALLERLNG}"; then + if grep -qi '^!insertmacro MUI_LANGUAGE "'"${LANG_NAME}"'"' "$BASE_DIR/${INSTALLERLNG}"; then echo "ok" else echo "ERROR, not found"