From: Karel Zak Date: Thu, 13 Mar 2025 13:46:38 +0000 (+0100) Subject: tools/poman-translate: fix to work outside on source dir X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=95833d8e5e32dea9781873cbbd4e8b01e02d8bad;p=thirdparty%2Futil-linux.git tools/poman-translate: fix to work outside on source dir * Let's check only the adoc file name if defined in po4a.cfg, not the complete path. cd .. meson setup build-dir util-linux ninja -C build-dir * Exclude manpage-stub.adoc (it's just an example) Addresses: https://github.com/util-linux/util-linux/pull/3378 Signed-off-by: Karel Zak --- diff --git a/tools/poman-translate.sh b/tools/poman-translate.sh index ff8fd5f1e..998a71183 100755 --- a/tools/poman-translate.sh +++ b/tools/poman-translate.sh @@ -90,13 +90,16 @@ MANADOCS=() PO4A_TRANSLATE_ONLY_FLAGS=() for LOCALE in "${LOCALES[@]}"; do for ADOC in "${ADOCS[@]}"; do - if [[ ! " ${PO4ACFG_TRANSLATIONS[*]} " =~ .*${ADOC}[[:space:]] ]]; then - echo "Untranslated: $LOCALE: $ADOC" - continue + if [[ "$ADOC" == *"/man-common/manpage-stub.adoc" ]]; then + continue + fi + ADOC_NAME=$(basename "$ADOC") + if [[ ! " ${PO4ACFG_TRANSLATIONS[*]} " =~ .*${ADOC_NAME}[[:space:]] ]]; then + echo "unconfigured in $PO4ACFG: $ADOC" + continue fi PO4A_TRANSLATE_ONLY_FLAGS+=("--translate-only") - ADOC_NAME=$(basename "$ADOC") - if [[ "$ADOC" == *"/man-common/"* ]]; then + if [[ "$ADOC" == *"/man-common/"* ]]; then PO4A_TRANSLATE_ONLY_FLAGS+=("$LOCALE/man-common/$ADOC_NAME") else MANADOCS+=("$LOCALE/$ADOC_NAME")