guestfs-tools/0011-po-docs-Run-po4a-trans...

43 lines
1.5 KiB
Diff

From 8a942cdd8e6d1aa526844c428660d0bb4ca02770 Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Thu, 4 Apr 2024 09:38:28 +0100
Subject: [PATCH] po-docs: Run po4a-translate and sed commands separately
I noticed that 1-byte translated POD files were being generated in the
output directory (po-docs/ja/). This seems to have happened because
po4a-translate was generating an error, but because we were
immediately pipeing the output into sed the error was suppressed.
By running them as two separate commands this cannot happen.
Fixes: commit bd896d68c06d7f66303bd77daa666367b0de5f3a
(cherry picked from libguestfs commit d755070346c0498672517c844d7ced52e9263197)
(cherry picked from commit 8c8da80adf8a9e3c350b010b5724a5ae7d9875b6)
---
po-docs/language.mk | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/po-docs/language.mk b/po-docs/language.mk
index b4e3544ca..ba2e36998 100644
--- a/po-docs/language.mk
+++ b/po-docs/language.mk
@@ -101,13 +101,16 @@ virt-sysprep.1: virt-sysprep.pod sysprep-extra-options.pod sysprep-operations.po
# Remove both.
# XXX Fix po4a so it doesn't do this.
%.pod: $(srcdir)/../$(LINGUA).po
+ rm -f $@ $@-t
$(guestfs_am_v_po4a_translate)$(PO4A_TRANSLATE) \
-f pod \
-M utf-8 -L utf-8 \
-k 0 \
-m $(top_srcdir)/$(shell grep -E '/$(basename $@)(\.|$$)' $(top_srcdir)/po-docs/podfiles) \
-p $< \
- | $(SED) '0,/^=encoding/d' > $@
+ -l $@-t
+ $(SED) '0,/^=encoding/d' < $@-t > $@
+ rm $@-t
# XXX Can automake do this properly?
install-data-hook: