1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-03-18 16:53:33 +01:00

m4/wm_i18n.m4: Make compatible with POSIX sed

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: Страхиња Радић <sr@strahinja.org>
This commit is contained in:
Страхиња Радић
2025-10-27 13:56:11 +01:00
committed by Carlos R. Mafra
parent da676c9e9e
commit 7bb7d0f4d6

View File

@@ -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