0002-Handle-gettext_printf-shell-function.patch 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From fd17c51f2e6c87427679fbdfb5f6224ff48795db Mon Sep 17 00:00:00 2001
  2. From: Colin Watson <cjwatson@debian.org>
  3. Date: Sun, 1 Mar 2020 12:00:41 +0000
  4. Subject: [PATCH 2/4] Handle gettext_printf shell function
  5. Extract gettext_printf arguments.
  6. Run grub.d.sed over strings extracted from util/grub.d/, in order to set
  7. c-format flags (xgettext refuses to include these itself for strings it
  8. extracted from a shell file, but these really are c-format).
  9. ---
  10. gettext-runtime/po/Makefile.in.in | 8 ++++++--
  11. 1 file changed, 6 insertions(+), 2 deletions(-)
  12. diff --git a/gettext-runtime/po/Makefile.in.in b/gettext-runtime/po/Makefile.in.in
  13. index 32e9323d3..32e0c99a2 100644
  14. --- a/gettext-runtime/po/Makefile.in.in
  15. +++ b/gettext-runtime/po/Makefile.in.in
  16. @@ -183,7 +183,8 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in $(srcdir)/POTFILES-shell
  17. --files-from=$(srcdir)/POTFILES-shell.in \
  18. --copyright-holder='$(COPYRIGHT_HOLDER)' \
  19. --msgid-bugs-address="$$msgid_bugs_address" \
  20. - --join-existing --language=Shell --keyword=gettext_quoted \
  21. + --join-existing --language=Shell \
  22. + --keyword=gettext_quoted --keyword=gettext_printf \
  23. ;; \
  24. *) \
  25. $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
  26. @@ -193,10 +194,13 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in $(srcdir)/POTFILES-shell
  27. --package-name="$${package_gnu}@PACKAGE@" \
  28. --package-version='@VERSION@' \
  29. --msgid-bugs-address="$$msgid_bugs_address" \
  30. - --join-existing --language=Shell --keyword=gettext_quoted \
  31. + --join-existing --language=Shell \
  32. + --keyword=gettext_quoted --keyword=gettext_printf \
  33. ;; \
  34. esac; \
  35. test ! -f $(DOMAIN).po || { \
  36. + sed -f grub.d.sed < $(DOMAIN).po > $(DOMAIN).1po && \
  37. + mv $(DOMAIN).1po $(DOMAIN).po; \
  38. if test -f $(srcdir)/$(DOMAIN).pot; then \
  39. sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
  40. sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
  41. --
  42. 2.17.1