On 2023-Oct-27, Ryo Matsumura (Fujitsu) wrote: > Hi hackers, > > I found that 'make update-po' for PGXS does not work. > Even if execute 'make update-po', but xx.po.new is not generated. > I don't test and check for meson build system, but I post it tentatively. > > I attached patch and test set. > 'update-po' tries to find *.po files $top_srcdir, but there is no po-file in > PGXS system because $top_srcdir is install directory.
Thanks. I think you have the order of the ifdef nest backwards; even in the PGXS case we should have "ALL_LANGUAGES = $(AVAIL_LANGUAGES)" unless we're making update-po. Here I present it the other way around. Regards -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "World domination is proceeding according to plan" (Andrew Morton)
>From 7c1e3d06f4ad09500cc233c91fc4108ef58ae638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Herrera?= <alvhe...@alvh.no-ip.org> Date: Tue, 20 Aug 2024 20:38:15 -0400 Subject: [PATCH v2] fix update-po for the PGXS case Author: Ryo Matsumura <matsumura....@fujitsu.com> Discussion: https://postgr.es/m/tycpr01mb113164770fb0b0be6ed21e68ee8...@tycpr01mb11316.jpnprd01.prod.outlook.com --- src/nls-global.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nls-global.mk b/src/nls-global.mk index dfff472cb3..73a6db10a1 100644 --- a/src/nls-global.mk +++ b/src/nls-global.mk @@ -142,8 +142,13 @@ init-po: po/$(CATALOG_NAME).pot # For performance reasons, only calculate these when the user actually # requested update-po or a specific file. ifneq (,$(filter update-po %.po.new,$(MAKECMDGOALS))) +ifdef PGXS +ALL_LANGUAGES := $(shell find . -name '*.po' -print | sed 's,^.*/\([^/]*\).po$$,\1,' | LC_ALL=C sort -u) +all_compendia := $(shell find . -name '*.po' -print | LC_ALL=C sort) +else ALL_LANGUAGES := $(shell find $(top_srcdir) -name '*.po' -print | sed 's,^.*/\([^/]*\).po$$,\1,' | LC_ALL=C sort -u) all_compendia := $(shell find $(top_srcdir) -name '*.po' -print | LC_ALL=C sort) +endif else ALL_LANGUAGES = $(AVAIL_LANGUAGES) all_compendia = FORCE -- 2.39.2