[PATCH] m4/wm_i18n.m4: Make compatible with POSIX sed

4 views
Skip to first unread message

Страхиња Радић

unread,
Oct 27, 2025, 9:00:33 AMOct 27
to wmake...@googlegroups.com, Страхиња Радић
Currently, it seems like the script m4/wm_i18n.m4 is passing some editing
commands to sed(1), which are not strictly conforming to POSIX[1]. Namely, the
"grouping" command:

{ command; command }

needs to have either a semicolon or a newline before the closing brace:

{ command; command; }

or

{ command; command
}

according to POSIX.

On systems which don't use the lax GNU sed by default (like OpenBSD), the
current configuration and compilation goes like this:

$ autoreconf -vif

...
sed: 1: "/po$/{s,.po,,;p}": extra characters at the end of p command
sed: 1: "/po$/{s,.po,,;p}": extra characters at the end of p command
... (etc)

$ ./configure --without-menu-textdomain CATALOGS=sr.mo LINGUAS=sr \
LIBS=-lintl MSGFMT=msgfmt --mandir=/usr/local/man

...

Translated languages to support :

configure: WARNING: No language from $LINGUAS are supported

$ gmake && doas gmake install
... (no .mo files are generated nor installed)

and so on, since the editing commands in question are affecting the processing
of .po files.

This patch proposes inserting semicolons before the closing brace in the
mentioned editing commands passed to sed(1).

[1]: https://pubs.opengroup.org/onlinepubs/9799919799/utilities/sed.html#tag_20_109_13_03

Signed-off-by: Страхиња Радић <s...@strahinja.org>
---
m4/wm_i18n.m4 | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/m4/wm_i18n.m4 b/m4/wm_i18n.m4
index 460a5d36..9fae9c45 100644
--- a/m4/wm_i18n.m4
+++ b/m4/wm_i18n.m4
@@ -37,7 +37,7 @@ AC_DEFUN_ONCE([WM_I18N_LANGUAGES],
[AC_ARG_VAR([LINGUAS],
[list of language translations to support (I18N), use 'list' to get the list of supported languages, default: none])dnl
AC_DEFUN([WM_ALL_LANGUAGES],
- [m4_esyscmd([( ls wrlib/po/ ; ls WINGs/po/ ; ls po/ ; ls WPrefs.app/po/ ; ls util/po/ ) | sed -n -e '/po$/{s,\.po,,;p}' | sort -u | tr '\n' ' '])])dnl
+ [m4_esyscmd([( ls wrlib/po/ ; ls WINGs/po/ ; ls po/ ; ls WPrefs.app/po/ ; ls util/po/ ) | sed -n -e '/po$/{s,\.po,,;p;}' | sort -u | tr '\n' ' '])])dnl
dnl We 'divert' the macro to have it executed as soon as the option list have
dnl been processed, so the list of locales will be printed after the configure
dnl options have been parsed, but before any test have been run
@@ -66,11 +66,11 @@ AS_IF([test "x$LINGUAS" != "x"],
supported_locales=""

# This is the list of locales that our archive currently supports
- wraster_locales=" m4_esyscmd([ls wrlib/po/ | sed -n '/po$/{s,.po,,;p}' | tr '\n' ' '])"
- wings_locales=" m4_esyscmd([ls WINGs/po/ | sed -n '/po$/{s,.po,,;p}' | tr '\n' ' '])"
- wmaker_locales=" m4_esyscmd([ls po/ | sed -n '/po$/{s,.po,,;p}' | tr '\n' ' '])"
- wprefs_locales=" m4_esyscmd([ls WPrefs.app/po/ | sed -n '/po$/{s,.po,,;p}' | tr '\n' ' '])"
- util_locales=" m4_esyscmd([ls util/po/ | sed -n '/po$/{s,.po,,;p}' | tr '\n' ' '])"
+ wraster_locales=" m4_esyscmd([ls wrlib/po/ | sed -n '/po$/{s,.po,,;p;}' | tr '\n' ' '])"
+ wings_locales=" m4_esyscmd([ls WINGs/po/ | sed -n '/po$/{s,.po,,;p;}' | tr '\n' ' '])"
+ wmaker_locales=" m4_esyscmd([ls po/ | sed -n '/po$/{s,.po,,;p;}' | tr '\n' ' '])"
+ wprefs_locales=" m4_esyscmd([ls WPrefs.app/po/ | sed -n '/po$/{s,.po,,;p;}' | tr '\n' ' '])"
+ util_locales=" m4_esyscmd([ls util/po/ | sed -n '/po$/{s,.po,,;p;}' | tr '\n' ' '])"
man_locales=" m4_esyscmd([ls doc/ | grep '^[a-z][a-z]\(_[A-Z][A-Z]\)*$' | tr '\n' ' '])"

# If the LINGUAS is specified as a simple '*', then we enable all the languages
--
2.51.0

Reply all
Reply to author
Forward
0 new messages