]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tools/poman-translate: fix to work outside on source dir
authorKarel Zak <kzak@redhat.com>
Thu, 13 Mar 2025 13:46:38 +0000 (14:46 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 13 Mar 2025 18:47:56 +0000 (19:47 +0100)
* 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 <kzak@redhat.com>
tools/poman-translate.sh

index ff8fd5f1ed95172e13505dba881e37ac01c59e79..998a711833e4eb3680fb964d40e523bde28f1381 100755 (executable)
@@ -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")