make update-po@master stops at pg_upgrade

Started by Kyotaro Horiguchiover 3 years ago17 messages
#1Kyotaro Horiguchi
horikyota.ntt@gmail.com
2 attachment(s)

I'm not sure if it fits -hackers, but seems better than -translators.

I find it annoying that make update-po stops at pg_upgrade on master.
The cause is that a file is renamed from relfilenode.c to
relfilenumber.c so just fixing the name works. (attached first).

On the other hand, basically, every nls.mk contain all *.c files in the
tool's directory plus some in other directories with some exceptions:

a) nls.mk of pg_dump and psql contain some *.h files but they don't
contain a translatable string.

b) nls.mk of ecpglib is missing some files that contain translatable
strings. (adding theses files doesn't change the result of make
update-po, but I'll send another mail for this issue.)

c) nls.mk of pg_waldump, psql, libpq and preproc excludes some *.c
files which don't contain a translatable string.

At least for (a) above, removing them from nls.mk is rather good. For
(b), adding them is also good. For (c), I think few extra files
doesn't make difference.

I wonder if we can use $(wildcard *.c) instead of explicitly
enumerating every *.c file in the directory then maintaining the
list. Since backend does that way, I think we can do that the same way
also for the tools. Attached second does that except for tools that
have only one *.c. The patch doesn't make a difference in the result
of make update-po.

Either will do for me but at least I'd like (a) applied.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachments:

pg_upgrade_nls_mk_relfilenumber.patchtext/x-patch; charset=us-asciiDownload
diff --git a/src/bin/pg_upgrade/nls.mk b/src/bin/pg_upgrade/nls.mk
index bfaacfbb7c..2488b8c406 100644
--- a/src/bin/pg_upgrade/nls.mk
+++ b/src/bin/pg_upgrade/nls.mk
@@ -2,7 +2,7 @@
 CATALOG_NAME     = pg_upgrade
 AVAIL_LANGUAGES  = cs de es fr ja ko ru sv tr uk zh_CN
 GETTEXT_FILES    = check.c controldata.c dump.c exec.c file.c function.c \
-                   info.c option.c parallel.c pg_upgrade.c relfilenode.c \
+                   info.c option.c parallel.c pg_upgrade.c relfilenumber.c \
                    server.c tablespace.c util.c version.c
 GETTEXT_TRIGGERS = pg_fatal pg_log:2 prep_status prep_status_progress report_status:2
 GETTEXT_FLAGS    = \
nls_mk_use_wildcard.patchtext/x-patch; charset=us-asciiDownload
diff --git a/src/bin/initdb/nls.mk b/src/bin/initdb/nls.mk
index fe7bdfc04a..df3287e95b 100644
--- a/src/bin/initdb/nls.mk
+++ b/src/bin/initdb/nls.mk
@@ -1,6 +1,6 @@
 # src/bin/initdb/nls.mk
 CATALOG_NAME     = initdb
 AVAIL_LANGUAGES  = cs de el es fr he it ja ko pl pt_BR ru sv tr uk vi zh_CN
-GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) findtimezone.c initdb.c ../../common/exec.c ../../common/fe_memutils.c ../../common/file_utils.c ../../common/pgfnames.c ../../common/restricted_token.c ../../common/rmtree.c ../../common/username.c ../../common/wait_error.c ../../port/dirmod.c
+GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) $(wildcard *.c) ../../common/exec.c ../../common/fe_memutils.c ../../common/file_utils.c ../../common/pgfnames.c ../../common/restricted_token.c ../../common/rmtree.c ../../common/username.c ../../common/wait_error.c ../../port/dirmod.c
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) simple_prompt
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/bin/pg_basebackup/nls.mk b/src/bin/pg_basebackup/nls.mk
index ec7393d321..1750e7ba94 100644
--- a/src/bin/pg_basebackup/nls.mk
+++ b/src/bin/pg_basebackup/nls.mk
@@ -2,18 +2,7 @@
 CATALOG_NAME     = pg_basebackup
 AVAIL_LANGUAGES  = cs de es fr he it ja ko pl pt_BR ru sv tr uk vi zh_CN
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   bbstreamer_file.c \
-                   bbstreamer_gzip.c \
-                   bbstreamer_inject.c \
-                   bbstreamer_lz4.c \
-                   bbstreamer_tar.c \
-                   bbstreamer_zstd.c \
-                   pg_basebackup.c \
-                   pg_receivewal.c \
-                   pg_recvlogical.c \
-                   receivelog.c \
-                   streamutil.c \
-                   walmethods.c \
+                   $(wildcard *.c) \
                    ../../common/compression.c \
                    ../../common/fe_memutils.c \
                    ../../common/file_utils.c \
diff --git a/src/bin/pg_dump/nls.mk b/src/bin/pg_dump/nls.mk
index dc7360db48..059c862ffb 100644
--- a/src/bin/pg_dump/nls.mk
+++ b/src/bin/pg_dump/nls.mk
@@ -2,12 +2,7 @@
 CATALOG_NAME     = pg_dump
 AVAIL_LANGUAGES  = cs de el es fr he it ja ko pl pt_BR ru sv tr uk zh_CN
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   pg_backup_archiver.c pg_backup_db.c pg_backup_custom.c \
-                   pg_backup_null.c pg_backup_tar.c \
-                   pg_backup_directory.c dumputils.c compress_io.c \
-                   pg_dump.c common.c pg_dump_sort.c \
-                   pg_restore.c pg_dumpall.c \
-                   parallel.c parallel.h pg_backup_utils.c pg_backup_utils.h \
+                   $(wildcard *.c) \
                    ../../common/exec.c ../../common/fe_memutils.c \
                    ../../common/wait_error.c \
                    ../../fe_utils/option_utils.c
diff --git a/src/bin/pg_rewind/nls.mk b/src/bin/pg_rewind/nls.mk
index e9d91a39cb..a123b101bf 100644
--- a/src/bin/pg_rewind/nls.mk
+++ b/src/bin/pg_rewind/nls.mk
@@ -1,7 +1,7 @@
 # src/bin/pg_rewind/nls.mk
 CATALOG_NAME     = pg_rewind
 AVAIL_LANGUAGES  = cs de el es fr it ja ko pl pt_BR ru sv tr uk zh_CN
-GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) datapagemap.c file_ops.c filemap.c libpq_source.c local_source.c parsexlog.c pg_rewind.c timeline.c xlogreader.c ../../common/fe_memutils.c ../../common/restricted_token.c ../../fe_utils/archive.c ../../fe_utils/recovery_gen.c
+GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) $(wildcard *.c) ../../common/fe_memutils.c ../../common/restricted_token.c ../../fe_utils/archive.c ../../fe_utils/recovery_gen.c
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) report_invalid_record:2
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS) \
     report_invalid_record:2:c-format
diff --git a/src/bin/pg_upgrade/nls.mk b/src/bin/pg_upgrade/nls.mk
index bfaacfbb7c..a1aed49ab6 100644
--- a/src/bin/pg_upgrade/nls.mk
+++ b/src/bin/pg_upgrade/nls.mk
@@ -1,9 +1,7 @@
 # src/bin/pg_upgrade/nls.mk
 CATALOG_NAME     = pg_upgrade
 AVAIL_LANGUAGES  = cs de es fr ja ko ru sv tr uk zh_CN
-GETTEXT_FILES    = check.c controldata.c dump.c exec.c file.c function.c \
-                   info.c option.c parallel.c pg_upgrade.c relfilenode.c \
-                   server.c tablespace.c util.c version.c
+GETTEXT_FILES    = $(wildcard *.c)
 GETTEXT_TRIGGERS = pg_fatal pg_log:2 prep_status prep_status_progress report_status:2
 GETTEXT_FLAGS    = \
     pg_fatal:1:c-format \
diff --git a/src/bin/pg_verifybackup/nls.mk b/src/bin/pg_verifybackup/nls.mk
index 81b96356da..3d4bf2deed 100644
--- a/src/bin/pg_verifybackup/nls.mk
+++ b/src/bin/pg_verifybackup/nls.mk
@@ -2,8 +2,7 @@
 CATALOG_NAME     = pg_verifybackup
 AVAIL_LANGUAGES  = de el es fr ja ko ru sv uk zh_CN
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   parse_manifest.c \
-                   pg_verifybackup.c \
+                   $(wildcard *.c) \
                    ../../common/fe_memutils.c \
                    ../../common/jsonapi.c
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) \
diff --git a/src/bin/pg_waldump/nls.mk b/src/bin/pg_waldump/nls.mk
index 159638fc00..18fb46ea7d 100644
--- a/src/bin/pg_waldump/nls.mk
+++ b/src/bin/pg_waldump/nls.mk
@@ -1,6 +1,6 @@
 # src/bin/pg_waldump/nls.mk
 CATALOG_NAME     = pg_waldump
 AVAIL_LANGUAGES  = cs de el es fr ja ko ru sv tr uk vi zh_CN
-GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) pg_waldump.c
+GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) $(wildcard *.c)
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS)
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/bin/psql/nls.mk b/src/bin/psql/nls.mk
index 52c96e3677..eed6aaa2ea 100644
--- a/src/bin/psql/nls.mk
+++ b/src/bin/psql/nls.mk
@@ -2,10 +2,7 @@
 CATALOG_NAME     = psql
 AVAIL_LANGUAGES  = cs de el es fr he it ja ko pl pt_BR ru sv tr uk zh_CN zh_TW
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   command.c common.c copy.c crosstabview.c help.c input.c large_obj.c \
-                   mainloop.c psqlscanslash.c startup.c \
-                   describe.c sql_help.h sql_help.c \
-                   tab-complete.c variables.c \
+                   $(wildcard *.c) \
                    ../../fe_utils/cancel.c ../../fe_utils/print.c ../../fe_utils/psqlscan.c \
                    ../../common/exec.c ../../common/fe_memutils.c ../../common/username.c \
                    ../../common/wait_error.c ../../port/thread.c
diff --git a/src/bin/scripts/nls.mk b/src/bin/scripts/nls.mk
index f61ff79396..04ac31c3e2 100644
--- a/src/bin/scripts/nls.mk
+++ b/src/bin/scripts/nls.mk
@@ -2,11 +2,7 @@
 CATALOG_NAME     = pgscripts
 AVAIL_LANGUAGES  = cs de el es fr he it ja ko pl pt_BR ru sv tr uk zh_CN
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   createdb.c createuser.c \
-                   dropdb.c dropuser.c \
-                   clusterdb.c vacuumdb.c reindexdb.c \
-                   pg_isready.c \
-                   common.c \
+                   $(wildcard *.c) \
                    ../../fe_utils/parallel_slot.c \
                    ../../fe_utils/cancel.c ../../fe_utils/print.c \
                    ../../fe_utils/connect_utils.c \
diff --git a/src/interfaces/ecpg/ecpglib/nls.mk b/src/interfaces/ecpg/ecpglib/nls.mk
index 2f6b0895f5..622b15c332 100644
--- a/src/interfaces/ecpg/ecpglib/nls.mk
+++ b/src/interfaces/ecpg/ecpglib/nls.mk
@@ -1,6 +1,6 @@
 # src/interfaces/ecpg/ecpglib/nls.mk
 CATALOG_NAME     = ecpglib
 AVAIL_LANGUAGES  = cs de el es fr it ja ko pl pt_BR ru sv tr uk vi zh_CN
-GETTEXT_FILES    = connect.c descriptor.c error.c execute.c misc.c
+GETTEXT_FILES    = $(wildcard *.c)
 GETTEXT_TRIGGERS = ecpg_gettext
 GETTEXT_FLAGS    = ecpg_gettext:1:pass-c-format
diff --git a/src/interfaces/ecpg/preproc/nls.mk b/src/interfaces/ecpg/preproc/nls.mk
index fed0f7c9e5..29bbb6dd52 100644
--- a/src/interfaces/ecpg/preproc/nls.mk
+++ b/src/interfaces/ecpg/preproc/nls.mk
@@ -1,6 +1,6 @@
 # src/interfaces/ecpg/preproc/nls.mk
 CATALOG_NAME     = ecpg
 AVAIL_LANGUAGES  = cs de el es fr it ja ko pl pt_BR ru sv tr uk vi zh_CN zh_TW
-GETTEXT_FILES    = descriptor.c ecpg.c pgc.c preproc.c type.c variable.c
+GETTEXT_FILES    = $(wildcard *.c)
 GETTEXT_TRIGGERS = mmerror:3 mmfatal:2
 GETTEXT_FLAGS    = mmerror:3:c-format mmfatal:2:c-format
diff --git a/src/interfaces/libpq/nls.mk b/src/interfaces/libpq/nls.mk
index 1f62ba1b57..800d482a0a 100644
--- a/src/interfaces/libpq/nls.mk
+++ b/src/interfaces/libpq/nls.mk
@@ -1,6 +1,6 @@
 # src/interfaces/libpq/nls.mk
 CATALOG_NAME     = libpq
 AVAIL_LANGUAGES  = cs de el es fr he it ja ko pl pt_BR ru sv tr uk zh_CN zh_TW
-GETTEXT_FILES    = fe-auth.c fe-auth-scram.c fe-connect.c fe-exec.c fe-gssapi-common.c fe-lobj.c fe-misc.c fe-protocol3.c fe-secure.c fe-secure-common.c fe-secure-gssapi.c fe-secure-openssl.c win32.c ../../port/thread.c
+GETTEXT_FILES    = $(wildcard *.c) ../../port/thread.c
 GETTEXT_TRIGGERS = libpq_gettext pqInternalNotice:2
 GETTEXT_FLAGS    = libpq_gettext:1:pass-c-format pqInternalNotice:2:c-format
diff --git a/src/pl/plperl/nls.mk b/src/pl/plperl/nls.mk
index ccdf1c3316..f4e32649bf 100644
--- a/src/pl/plperl/nls.mk
+++ b/src/pl/plperl/nls.mk
@@ -1,6 +1,6 @@
 # src/pl/plperl/nls.mk
 CATALOG_NAME     = plperl
 AVAIL_LANGUAGES  = cs de el es fr it ja ko pl pt_BR ro ru sv tr uk vi zh_CN zh_TW
-GETTEXT_FILES    = plperl.c SPI.c
+GETTEXT_FILES    = $(wildcard *.c)
 GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS)
 GETTEXT_FLAGS    = $(BACKEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/pl/plpgsql/src/nls.mk b/src/pl/plpgsql/src/nls.mk
index 11878d2d5b..a5c331d3f1 100644
--- a/src/pl/plpgsql/src/nls.mk
+++ b/src/pl/plpgsql/src/nls.mk
@@ -1,6 +1,6 @@
 # src/pl/plpgsql/src/nls.mk
 CATALOG_NAME     = plpgsql
 AVAIL_LANGUAGES  = cs de el es fr it ja ko pl pt_BR ro ru sv tr uk vi zh_CN zh_TW
-GETTEXT_FILES    = pl_comp.c pl_exec.c pl_gram.c pl_funcs.c pl_handler.c pl_scanner.c
+GETTEXT_FILES    = $(wildcard *.c)
 GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) yyerror plpgsql_yyerror
 GETTEXT_FLAGS    = $(BACKEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/pl/plpython/nls.mk b/src/pl/plpython/nls.mk
index c46e26200b..e4c40ff409 100644
--- a/src/pl/plpython/nls.mk
+++ b/src/pl/plpython/nls.mk
@@ -1,8 +1,7 @@
 # src/pl/plpython/nls.mk
 CATALOG_NAME     = plpython
 AVAIL_LANGUAGES  = cs de el es fr it ja ko pl pt_BR ru sv tr uk vi zh_CN
-GETTEXT_FILES    = plpy_cursorobject.c plpy_elog.c plpy_exec.c plpy_main.c plpy_planobject.c plpy_plpymodule.c \
-                   plpy_procedure.c plpy_resultobject.c plpy_spi.c plpy_subxactobject.c plpy_typeio.c plpy_util.c
+GETTEXT_FILES    = $(wildcard *.c)
 GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) PLy_elog:2 PLy_exception_set:2 PLy_exception_set_plural:2,3
 GETTEXT_FLAGS    = $(BACKEND_COMMON_GETTEXT_FLAGS) \
     PLy_elog:2:c-format \
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kyotaro Horiguchi (#1)
Re: make update-po@master stops at pg_upgrade

Kyotaro Horiguchi <horikyota.ntt@gmail.com> writes:

I find it annoying that make update-po stops at pg_upgrade on master.
The cause is that a file is renamed from relfilenode.c to
relfilenumber.c so just fixing the name works. (attached first).

Ooops.

I wonder if we can use $(wildcard *.c) instead of explicitly
enumerating every *.c file in the directory then maintaining the
list.

+1. We've repeatedly forgotten to update the nls.mk files when
adding/removing files; they're just not on most hackers' radar.
Anything we can do to make that more automatic seems like a win.

Since backend does that way, I think we can do that the same way
also for the tools. Attached second does that except for tools that
have only one *.c. The patch doesn't make a difference in the result
of make update-po.

I wonder if there's anything we can do about the manual cross-references
to src/common. We could wildcard that, but then every FE program would
have to contain translations for all messages in src/common/, even for
modules it doesn't use.

Still, wildcarding the local *.c references seems like a clear step
forward. I'll go push that part.

regards, tom lane

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#2)
Re: make update-po@master stops at pg_upgrade

I wrote:

Kyotaro Horiguchi <horikyota.ntt@gmail.com> writes:

Since backend does that way, I think we can do that the same way
also for the tools. Attached second does that except for tools that
have only one *.c. The patch doesn't make a difference in the result
of make update-po.

Still, wildcarding the local *.c references seems like a clear step
forward. I'll go push that part.

I had to recreate the patch almost from scratch, because 88dad06b4
touched adjacent lines in most of these files, scaring patch(1)
away from applying the changes. That being the case, I decided
to use $(wildcard *.c) everywhere, including the places where there's
currently just one *.c file. It seems to work for me, but please check.

regards, tom lane

#4Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Tom Lane (#3)
Re: make update-po@master stops at pg_upgrade

On 2022-Jul-13, Tom Lane wrote:

I had to recreate the patch almost from scratch, because 88dad06b4
touched adjacent lines in most of these files, scaring patch(1)
away from applying the changes. That being the case, I decided
to use $(wildcard *.c) everywhere, including the places where there's
currently just one *.c file. It seems to work for me, but please check.

Hmm, I got this failure:

make[4]: se entra en el directorio '/home/alvherre/Code/pgsql-build/master/src/interfaces/ecpg/ecpglib'
/usr/bin/xgettext -ctranslator --copyright-holder='PostgreSQL Global Development Group' --msgid-bugs-address=pgsql-bugs@lists.postgresql.org --no-wrap --sort-by-file --package-name='ecpglib (PostgreSQL)' --package-version='16' -D /pgsql/source/master/src/interfaces/ecpg/ecpglib -D . -n -kecpg_gettext -k_ --flag=ecpg_gettext:1:pass-c-format --flag=_:1:pass-c-format
/usr/bin/xgettext: no se especificó el fichero de entrada
Pruebe '/usr/bin/xgettext --help' para más información.
make[4]: *** [/pgsql/source/master/src/nls-global.mk:108: po/ecpglib.pot] Error 1

The error from xgettext, of course, is
/usr/bin/xgettext: no input file given

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"Puedes vivir sólo una vez, pero si lo haces bien, una vez es suficiente"

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#4)
Re: make update-po@master stops at pg_upgrade

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

Hmm, I got this failure:
/usr/bin/xgettext: no se especificó el fichero de entrada

Hmm ... are you doing this in a VPATH setup? Does it help
if you make the entry be

GETTEXT_FILES = $(wildcard $(srcdir)/*.c)

I'd supposed we didn't need to be careful about that, because
I saw uses of $(wildcard) without it ... but I now see other uses
with.

regards, tom lane

#6Peter Eisentraut
peter.eisentraut@enterprisedb.com
In reply to: Tom Lane (#2)
Re: make update-po@master stops at pg_upgrade

On 13.07.22 18:07, Tom Lane wrote:

Still, wildcarding the local *.c references seems like a clear step
forward. I'll go push that part.

In some cases, the listed files are build output from another rule, for
example sql_help.c. By using a wildcard, you just take whatever files
happen to be there, not observing proper make dependencies.
(Conversely, you could also include files that are not part of the
build, maybe leftover from something aborted.) So I'm not sure this is
such a clear win. In any case, someone should check that this creates
identical output before and after.

#7Peter Eisentraut
peter.eisentraut@enterprisedb.com
In reply to: Peter Eisentraut (#6)
Re: make update-po@master stops at pg_upgrade

On 13.07.22 20:09, Peter Eisentraut wrote:

In any case, someone should check that this creates identical output
before and after.

A quick check shows differences in

pg_rewind.pot
psql.pot
ecpg.pot
libpq.pot
plpgsql.pot

#8Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#6)
Re: make update-po@master stops at pg_upgrade

Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:

In some cases, the listed files are build output from another rule, for
example sql_help.c. By using a wildcard, you just take whatever files
happen to be there, not observing proper make dependencies.

Hmm. We could list built files explicitly, perhaps, and still be
a good step ahead on the maintenance burden. Does xgettext get
upset if the same input file is mentioned twice, ie would we have
to filter sql_help.c out of the wildcard result?

regards, tom lane

#9Peter Eisentraut
peter.eisentraut@enterprisedb.com
In reply to: Tom Lane (#5)
Re: make update-po@master stops at pg_upgrade

On 13.07.22 19:41, Tom Lane wrote:

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

Hmm, I got this failure:
/usr/bin/xgettext: no se especificó el fichero de entrada

Hmm ... are you doing this in a VPATH setup? Does it help
if you make the entry be

GETTEXT_FILES = $(wildcard $(srcdir)/*.c)

I'd supposed we didn't need to be careful about that, because
I saw uses of $(wildcard) without it ... but I now see other uses
with.

Note that we have this in nls-global.mk which tries to avoid having the
vpath details sneak into the output:

po/$(CATALOG_NAME).pot: $(GETTEXT_FILES) $(MAKEFILE_LIST)
# Change to srcdir explicitly, don't rely on $^. That way we get
# consistent #: file references in the po files.
...
$(XGETTEXT) -D $(srcdir) -D . -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $(addprefix --flag=, $(GETTEXT_FLAGS)) $(GETTEXT_FILES)

#10Peter Eisentraut
peter.eisentraut@enterprisedb.com
In reply to: Tom Lane (#8)
Re: make update-po@master stops at pg_upgrade

On 13.07.22 20:19, Tom Lane wrote:

Hmm. We could list built files explicitly, perhaps, and still be
a good step ahead on the maintenance burden. Does xgettext get
upset if the same input file is mentioned twice, ie would we have
to filter sql_help.c out of the wildcard result?

It seems it would be ok with that.

#11Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#9)
Re: make update-po@master stops at pg_upgrade

Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:

Note that we have this in nls-global.mk which tries to avoid having the
vpath details sneak into the output:

po/$(CATALOG_NAME).pot: $(GETTEXT_FILES) $(MAKEFILE_LIST)
# Change to srcdir explicitly, don't rely on $^. That way we get
# consistent #: file references in the po files.
...
$(XGETTEXT) -D $(srcdir) -D . -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $(addprefix --flag=, $(GETTEXT_FLAGS)) $(GETTEXT_FILES)

Hmm ... so how does that work with built files in a VPATH build today?

Anyway, I'll go revert the patch for now, since it's clearly got
at least a couple problems that need sorting.

regards, tom lane

#12Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#10)
1 attachment(s)
Re: make update-po@master stops at pg_upgrade

Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:

On 13.07.22 20:19, Tom Lane wrote:

Hmm. We could list built files explicitly, perhaps, and still be
a good step ahead on the maintenance burden. Does xgettext get
upset if the same input file is mentioned twice, ie would we have
to filter sql_help.c out of the wildcard result?

It seems it would be ok with that.

Actually, we can get rid of those easily enough anyway with $(sort).
Here's a draft that might solve these problems. The idea is to use
$(wildcard) for files in the srcdir, and manually enumerate only
built files.

regards, tom lane

Attachments:

use-wildcards-in-nls.mk-take-2.patchtext/x-diff; charset=us-ascii; name=use-wildcards-in-nls.mk-take-2.patchDownload
diff --git a/src/bin/initdb/nls.mk b/src/bin/initdb/nls.mk
index 19c9136849..54d6d034b5 100644
--- a/src/bin/initdb/nls.mk
+++ b/src/bin/initdb/nls.mk
@@ -1,5 +1,7 @@
 # src/bin/initdb/nls.mk
 CATALOG_NAME     = initdb
-GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) findtimezone.c initdb.c ../../common/exec.c ../../common/fe_memutils.c ../../common/file_utils.c ../../common/pgfnames.c ../../common/restricted_token.c ../../common/rmtree.c ../../common/username.c ../../common/wait_error.c ../../port/dirmod.c
+GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
+                   $(notdir $(wildcard $(srcdir)/*.c)) \
+                   ../../common/exec.c ../../common/fe_memutils.c ../../common/file_utils.c ../../common/pgfnames.c ../../common/restricted_token.c ../../common/rmtree.c ../../common/username.c ../../common/wait_error.c ../../port/dirmod.c
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) simple_prompt
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/bin/pg_amcheck/nls.mk b/src/bin/pg_amcheck/nls.mk
index 5e6171952c..1f70ed4c70 100644
--- a/src/bin/pg_amcheck/nls.mk
+++ b/src/bin/pg_amcheck/nls.mk
@@ -1,7 +1,7 @@
 # src/bin/pg_amcheck/nls.mk
 CATALOG_NAME     = pg_amcheck
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   pg_amcheck.c \
+                   $(notdir $(wildcard $(srcdir)/*.c)) \
                    ../../fe_utils/cancel.c \
                    ../../fe_utils/connect_utils.c \
                    ../../fe_utils/option_utils.c \
diff --git a/src/bin/pg_archivecleanup/nls.mk b/src/bin/pg_archivecleanup/nls.mk
index 801cf1c51e..8b4b64de8f 100644
--- a/src/bin/pg_archivecleanup/nls.mk
+++ b/src/bin/pg_archivecleanup/nls.mk
@@ -1,5 +1,6 @@
 # src/bin/pg_archivecleanup/nls.mk
 CATALOG_NAME     = pg_archivecleanup
-GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) pg_archivecleanup.c
+GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
+                   $(notdir $(wildcard $(srcdir)/*.c))
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS)
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/bin/pg_basebackup/nls.mk b/src/bin/pg_basebackup/nls.mk
index 8d28e249de..04af63ac3c 100644
--- a/src/bin/pg_basebackup/nls.mk
+++ b/src/bin/pg_basebackup/nls.mk
@@ -1,18 +1,7 @@
 # src/bin/pg_basebackup/nls.mk
 CATALOG_NAME     = pg_basebackup
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   bbstreamer_file.c \
-                   bbstreamer_gzip.c \
-                   bbstreamer_inject.c \
-                   bbstreamer_lz4.c \
-                   bbstreamer_tar.c \
-                   bbstreamer_zstd.c \
-                   pg_basebackup.c \
-                   pg_receivewal.c \
-                   pg_recvlogical.c \
-                   receivelog.c \
-                   streamutil.c \
-                   walmethods.c \
+                   $(notdir $(wildcard $(srcdir)/*.c)) \
                    ../../common/compression.c \
                    ../../common/fe_memutils.c \
                    ../../common/file_utils.c \
diff --git a/src/bin/pg_checksums/nls.mk b/src/bin/pg_checksums/nls.mk
index f7cd2a5ee9..0b08f46f4d 100644
--- a/src/bin/pg_checksums/nls.mk
+++ b/src/bin/pg_checksums/nls.mk
@@ -1,7 +1,7 @@
 # src/bin/pg_checksums/nls.mk
 CATALOG_NAME     = pg_checksums
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   pg_checksums.c \
+                   $(notdir $(wildcard $(srcdir)/*.c)) \
                    ../../fe_utils/option_utils.c
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS)
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/bin/pg_config/nls.mk b/src/bin/pg_config/nls.mk
index d86c28c404..8642be47e4 100644
--- a/src/bin/pg_config/nls.mk
+++ b/src/bin/pg_config/nls.mk
@@ -1,3 +1,4 @@
 # src/bin/pg_config/nls.mk
 CATALOG_NAME     = pg_config
-GETTEXT_FILES    = pg_config.c ../../common/config_info.c ../../common/exec.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c)) \
+                   ../../common/config_info.c ../../common/exec.c
diff --git a/src/bin/pg_controldata/nls.mk b/src/bin/pg_controldata/nls.mk
index ab34205b96..805085a56b 100644
--- a/src/bin/pg_controldata/nls.mk
+++ b/src/bin/pg_controldata/nls.mk
@@ -1,5 +1,6 @@
 # src/bin/pg_controldata/nls.mk
 CATALOG_NAME     = pg_controldata
-GETTEXT_FILES    = pg_controldata.c ../../common/controldata_utils.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c)) \
+                   ../../common/controldata_utils.c
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS)
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/bin/pg_ctl/nls.mk b/src/bin/pg_ctl/nls.mk
index 84e7fb4e56..6f1395d1cb 100644
--- a/src/bin/pg_ctl/nls.mk
+++ b/src/bin/pg_ctl/nls.mk
@@ -1,3 +1,4 @@
 # src/bin/pg_ctl/nls.mk
 CATALOG_NAME     = pg_ctl
-GETTEXT_FILES    = pg_ctl.c ../../common/exec.c ../../common/fe_memutils.c ../../common/wait_error.c ../../port/path.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c)) \
+                   ../../common/exec.c ../../common/fe_memutils.c ../../common/wait_error.c ../../port/path.c
diff --git a/src/bin/pg_dump/nls.mk b/src/bin/pg_dump/nls.mk
index 3054f93fad..e64090347d 100644
--- a/src/bin/pg_dump/nls.mk
+++ b/src/bin/pg_dump/nls.mk
@@ -1,12 +1,7 @@
 # src/bin/pg_dump/nls.mk
 CATALOG_NAME     = pg_dump
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   pg_backup_archiver.c pg_backup_db.c pg_backup_custom.c \
-                   pg_backup_null.c pg_backup_tar.c \
-                   pg_backup_directory.c dumputils.c compress_io.c \
-                   pg_dump.c common.c pg_dump_sort.c \
-                   pg_restore.c pg_dumpall.c \
-                   parallel.c parallel.h pg_backup_utils.c pg_backup_utils.h \
+                   $(notdir $(wildcard $(srcdir)/*.c)) \
                    ../../common/exec.c ../../common/fe_memutils.c \
                    ../../common/wait_error.c \
                    ../../fe_utils/option_utils.c
diff --git a/src/bin/pg_resetwal/nls.mk b/src/bin/pg_resetwal/nls.mk
index bc25482f2c..9ced597fcb 100644
--- a/src/bin/pg_resetwal/nls.mk
+++ b/src/bin/pg_resetwal/nls.mk
@@ -1,5 +1,7 @@
 # src/bin/pg_resetwal/nls.mk
 CATALOG_NAME     = pg_resetwal
-GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) pg_resetwal.c ../../common/restricted_token.c
+GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
+                   $(notdir $(wildcard $(srcdir)/*.c)) \
+                   ../../common/restricted_token.c
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS)
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/bin/pg_rewind/nls.mk b/src/bin/pg_rewind/nls.mk
index 0618cb8c2c..af3a644dd4 100644
--- a/src/bin/pg_rewind/nls.mk
+++ b/src/bin/pg_rewind/nls.mk
@@ -1,6 +1,10 @@
 # src/bin/pg_rewind/nls.mk
 CATALOG_NAME     = pg_rewind
-GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) datapagemap.c file_ops.c filemap.c libpq_source.c local_source.c parsexlog.c pg_rewind.c timeline.c xlogreader.c ../../common/fe_memutils.c ../../common/restricted_token.c ../../fe_utils/archive.c ../../fe_utils/recovery_gen.c
+GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
+                   $(notdir $(wildcard $(srcdir)/*.c)) \
+                   xlogreader.c \
+                   ../../common/fe_memutils.c ../../common/restricted_token.c \
+                   ../../fe_utils/archive.c ../../fe_utils/recovery_gen.c
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) report_invalid_record:2
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS) \
     report_invalid_record:2:c-format
diff --git a/src/bin/pg_test_fsync/nls.mk b/src/bin/pg_test_fsync/nls.mk
index a50782036c..ca5fdc05e1 100644
--- a/src/bin/pg_test_fsync/nls.mk
+++ b/src/bin/pg_test_fsync/nls.mk
@@ -1,5 +1,6 @@
 # src/bin/pg_test_fsync/nls.mk
 CATALOG_NAME     = pg_test_fsync
-GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) pg_test_fsync.c
+GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
+                   $(notdir $(wildcard $(srcdir)/*.c))
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) die
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/bin/pg_test_timing/nls.mk b/src/bin/pg_test_timing/nls.mk
index 331931c591..8cb472fbdf 100644
--- a/src/bin/pg_test_timing/nls.mk
+++ b/src/bin/pg_test_timing/nls.mk
@@ -1,3 +1,3 @@
 # src/bin/pg_test_timing/nls.mk
 CATALOG_NAME     = pg_test_timing
-GETTEXT_FILES    = pg_test_timing.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c))
diff --git a/src/bin/pg_upgrade/nls.mk b/src/bin/pg_upgrade/nls.mk
index 4721fa6b5a..a370717ba8 100644
--- a/src/bin/pg_upgrade/nls.mk
+++ b/src/bin/pg_upgrade/nls.mk
@@ -1,8 +1,6 @@
 # src/bin/pg_upgrade/nls.mk
 CATALOG_NAME     = pg_upgrade
-GETTEXT_FILES    = check.c controldata.c dump.c exec.c file.c function.c \
-                   info.c option.c parallel.c pg_upgrade.c relfilenumber.c \
-                   server.c tablespace.c util.c version.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c))
 GETTEXT_TRIGGERS = pg_fatal pg_log:2 prep_status prep_status_progress report_status:2
 GETTEXT_FLAGS    = \
     pg_fatal:1:c-format \
diff --git a/src/bin/pg_verifybackup/nls.mk b/src/bin/pg_verifybackup/nls.mk
index eba73a2c05..4a9d898259 100644
--- a/src/bin/pg_verifybackup/nls.mk
+++ b/src/bin/pg_verifybackup/nls.mk
@@ -1,8 +1,7 @@
 # src/bin/pg_verifybackup/nls.mk
 CATALOG_NAME     = pg_verifybackup
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   parse_manifest.c \
-                   pg_verifybackup.c \
+                   $(notdir $(wildcard $(srcdir)/*.c)) \
                    ../../common/fe_memutils.c \
                    ../../common/jsonapi.c
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS) \
diff --git a/src/bin/pg_waldump/nls.mk b/src/bin/pg_waldump/nls.mk
index a9eeb6712b..895df4900e 100644
--- a/src/bin/pg_waldump/nls.mk
+++ b/src/bin/pg_waldump/nls.mk
@@ -1,5 +1,6 @@
 # src/bin/pg_waldump/nls.mk
 CATALOG_NAME     = pg_waldump
-GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) pg_waldump.c
+GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
+                   $(notdir $(wildcard $(srcdir)/*.c))
 GETTEXT_TRIGGERS = $(FRONTEND_COMMON_GETTEXT_TRIGGERS)
 GETTEXT_FLAGS    = $(FRONTEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/bin/psql/nls.mk b/src/bin/psql/nls.mk
index dad5816b9c..8774838d89 100644
--- a/src/bin/psql/nls.mk
+++ b/src/bin/psql/nls.mk
@@ -1,10 +1,8 @@
 # src/bin/psql/nls.mk
 CATALOG_NAME     = psql
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   command.c common.c copy.c crosstabview.c help.c input.c large_obj.c \
-                   mainloop.c psqlscanslash.c startup.c \
-                   describe.c sql_help.h sql_help.c \
-                   tab-complete.c variables.c \
+                   $(notdir $(wildcard $(srcdir)/*.c)) \
+                   psqlscanslash.c sql_help.c \
                    ../../fe_utils/cancel.c ../../fe_utils/print.c ../../fe_utils/psqlscan.c \
                    ../../common/exec.c ../../common/fe_memutils.c ../../common/username.c \
                    ../../common/wait_error.c ../../port/thread.c
diff --git a/src/bin/scripts/nls.mk b/src/bin/scripts/nls.mk
index f4638a06f0..f788d00623 100644
--- a/src/bin/scripts/nls.mk
+++ b/src/bin/scripts/nls.mk
@@ -1,11 +1,7 @@
 # src/bin/scripts/nls.mk
 CATALOG_NAME     = pgscripts
 GETTEXT_FILES    = $(FRONTEND_COMMON_GETTEXT_FILES) \
-                   createdb.c createuser.c \
-                   dropdb.c dropuser.c \
-                   clusterdb.c vacuumdb.c reindexdb.c \
-                   pg_isready.c \
-                   common.c \
+                   $(notdir $(wildcard $(srcdir)/*.c)) \
                    ../../fe_utils/parallel_slot.c \
                    ../../fe_utils/cancel.c ../../fe_utils/print.c \
                    ../../fe_utils/connect_utils.c \
diff --git a/src/interfaces/ecpg/ecpglib/nls.mk b/src/interfaces/ecpg/ecpglib/nls.mk
index 77eecc98f3..24d7adb588 100644
--- a/src/interfaces/ecpg/ecpglib/nls.mk
+++ b/src/interfaces/ecpg/ecpglib/nls.mk
@@ -1,5 +1,5 @@
 # src/interfaces/ecpg/ecpglib/nls.mk
 CATALOG_NAME     = ecpglib
-GETTEXT_FILES    = connect.c descriptor.c error.c execute.c misc.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c))
 GETTEXT_TRIGGERS = ecpg_gettext
 GETTEXT_FLAGS    = ecpg_gettext:1:pass-c-format
diff --git a/src/interfaces/ecpg/preproc/nls.mk b/src/interfaces/ecpg/preproc/nls.mk
index 55ea19a44e..05164c9bbc 100644
--- a/src/interfaces/ecpg/preproc/nls.mk
+++ b/src/interfaces/ecpg/preproc/nls.mk
@@ -1,5 +1,6 @@
 # src/interfaces/ecpg/preproc/nls.mk
 CATALOG_NAME     = ecpg
-GETTEXT_FILES    = descriptor.c ecpg.c pgc.c preproc.c type.c variable.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c)) \
+                   pgc.c preproc.c typename.c
 GETTEXT_TRIGGERS = mmerror:3 mmfatal:2
 GETTEXT_FLAGS    = mmerror:3:c-format mmfatal:2:c-format
diff --git a/src/interfaces/libpq/nls.mk b/src/interfaces/libpq/nls.mk
index 9256b426c1..bf3eb9899d 100644
--- a/src/interfaces/libpq/nls.mk
+++ b/src/interfaces/libpq/nls.mk
@@ -1,5 +1,6 @@
 # src/interfaces/libpq/nls.mk
 CATALOG_NAME     = libpq
-GETTEXT_FILES    = fe-auth.c fe-auth-scram.c fe-connect.c fe-exec.c fe-gssapi-common.c fe-lobj.c fe-misc.c fe-protocol3.c fe-secure.c fe-secure-common.c fe-secure-gssapi.c fe-secure-openssl.c win32.c ../../port/thread.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c)) \
+                   ../../port/thread.c
 GETTEXT_TRIGGERS = libpq_gettext pqInternalNotice:2
 GETTEXT_FLAGS    = libpq_gettext:1:pass-c-format pqInternalNotice:2:c-format
diff --git a/src/nls-global.mk b/src/nls-global.mk
index f21bd5ed55..24f232892a 100644
--- a/src/nls-global.mk
+++ b/src/nls-global.mk
@@ -103,9 +103,11 @@ endif
 else # GETTEXT_FILES
 po/$(CATALOG_NAME).pot: $(GETTEXT_FILES) $(MAKEFILE_LIST)
 # Change to srcdir explicitly, don't rely on $^.  That way we get
-# consistent #: file references in the po files.
+# consistent #: file references in the po files.  Also, sort to eliminate
+# duplicate references that we might get from use of $(wildcard) alongside
+# explicit references to built files.
 ifdef XGETTEXT
-	$(XGETTEXT) -D $(srcdir) -D . -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $(addprefix --flag=, $(GETTEXT_FLAGS)) $(GETTEXT_FILES)
+	$(XGETTEXT) -D $(srcdir) -D . -n $(addprefix -k, $(GETTEXT_TRIGGERS)) $(addprefix --flag=, $(GETTEXT_FLAGS)) $(sort $(GETTEXT_FILES))
 else
 	@echo "You don't have 'xgettext'."; exit 1
 endif
diff --git a/src/pl/plperl/nls.mk b/src/pl/plperl/nls.mk
index 8c41bfac7a..aedc381d9f 100644
--- a/src/pl/plperl/nls.mk
+++ b/src/pl/plperl/nls.mk
@@ -1,5 +1,6 @@
 # src/pl/plperl/nls.mk
 CATALOG_NAME     = plperl
-GETTEXT_FILES    = plperl.c SPI.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c)) \
+                   SPI.c Util.c
 GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS)
 GETTEXT_FLAGS    = $(BACKEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/pl/plpgsql/src/nls.mk b/src/pl/plpgsql/src/nls.mk
index 2bd620a8dd..dada8b8855 100644
--- a/src/pl/plpgsql/src/nls.mk
+++ b/src/pl/plpgsql/src/nls.mk
@@ -1,5 +1,6 @@
 # src/pl/plpgsql/src/nls.mk
 CATALOG_NAME     = plpgsql
-GETTEXT_FILES    = pl_comp.c pl_exec.c pl_gram.c pl_funcs.c pl_handler.c pl_scanner.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c)) \
+                   pl_gram.c
 GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) yyerror plpgsql_yyerror
 GETTEXT_FLAGS    = $(BACKEND_COMMON_GETTEXT_FLAGS)
diff --git a/src/pl/plpython/nls.mk b/src/pl/plpython/nls.mk
index 4c68a0e571..cfb5abf71e 100644
--- a/src/pl/plpython/nls.mk
+++ b/src/pl/plpython/nls.mk
@@ -1,7 +1,6 @@
 # src/pl/plpython/nls.mk
 CATALOG_NAME     = plpython
-GETTEXT_FILES    = plpy_cursorobject.c plpy_elog.c plpy_exec.c plpy_main.c plpy_planobject.c plpy_plpymodule.c \
-                   plpy_procedure.c plpy_resultobject.c plpy_spi.c plpy_subxactobject.c plpy_typeio.c plpy_util.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c))
 GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS) PLy_elog:2 PLy_exception_set:2 PLy_exception_set_plural:2,3
 GETTEXT_FLAGS    = $(BACKEND_COMMON_GETTEXT_FLAGS) \
     PLy_elog:2:c-format \
diff --git a/src/pl/tcl/nls.mk b/src/pl/tcl/nls.mk
index 8366998df1..047e029cdd 100644
--- a/src/pl/tcl/nls.mk
+++ b/src/pl/tcl/nls.mk
@@ -1,5 +1,5 @@
 # src/pl/tcl/nls.mk
 CATALOG_NAME     = pltcl
-GETTEXT_FILES    = pltcl.c
+GETTEXT_FILES    = $(notdir $(wildcard $(srcdir)/*.c))
 GETTEXT_TRIGGERS = $(BACKEND_COMMON_GETTEXT_TRIGGERS)
 GETTEXT_FLAGS    = $(BACKEND_COMMON_GETTEXT_FLAGS)
#13Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Tom Lane (#12)
Re: make update-po@master stops at pg_upgrade

On 2022-Jul-13, Tom Lane wrote:

Actually, we can get rid of those easily enough anyway with $(sort).
Here's a draft that might solve these problems. The idea is to use
$(wildcard) for files in the srcdir, and manually enumerate only
built files.

I checked the files in src/bin/scripts and they look OK; there are no
missing messages now. I also checked the es.po.new files with and
without patch; they look good, nothing is lost.

Files that weren't previously being processed:
src/interfaces/libpq/fe-print.c
src/interfaces/ecpg/preproc/parser.c

Incidentally, this patch is pretty similar to what Kyotaro-san sent when
opening the thread, with the addition of the $(notdir) call.

In short, +1 to this patch.

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"El sentido de las cosas no viene de las cosas, sino de
las inteligencias que las aplican a sus problemas diarios
en busca del progreso." (Ernesto Hernández-Novich)

#14Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#13)
Re: make update-po@master stops at pg_upgrade

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

In short, +1 to this patch.

Thanks for testing it. I think the only remaining concern is
Peter's objection that $(wildcard) might pick up random junk files
that end in ".c". That's true, but the backend's nls.mk also
picks up everything matching "*.c" (over the whole backend tree,
not just one directory!), and I don't recall people complaining
about that. So I think the reduction in maintenance burden
justifies the risk. What do others think?

regards, tom lane

#15Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Tom Lane (#14)
Re: make update-po@master stops at pg_upgrade

On 2022-Jul-28, Tom Lane wrote:

Thanks for testing it. I think the only remaining concern is
Peter's objection that $(wildcard) might pick up random junk files
that end in ".c". That's true, but the backend's nls.mk also
picks up everything matching "*.c" (over the whole backend tree,
not just one directory!),

Now that I did the translation chores again after a few years I am
reminded of a point about this argument: in reality, few people ever
run this recipe manually (I know I never do), because it's easier to
grab the already-merged files from the NLS website. It all happens
mechanically and there's nobody leaving random junnk files.

--
Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/
"El que vive para el futuro es un iluso, y el que vive para el pasado,
un imbécil" (Luis Adler, "Los tripulantes de la noche")

#16Tom Lane
tgl@sss.pgh.pa.us
In reply to: Alvaro Herrera (#15)
Re: make update-po@master stops at pg_upgrade

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

On 2022-Jul-28, Tom Lane wrote:

Thanks for testing it. I think the only remaining concern is
Peter's objection that $(wildcard) might pick up random junk files
that end in ".c". That's true, but the backend's nls.mk also
picks up everything matching "*.c" (over the whole backend tree,
not just one directory!),

Now that I did the translation chores again after a few years I am
reminded of a point about this argument: in reality, few people ever
run this recipe manually (I know I never do), because it's easier to
grab the already-merged files from the NLS website. It all happens
mechanically and there's nobody leaving random junnk files.

Hmm, so where does the NLS website get its data?

I'd be all for flushing the recipe altogether if no one uses it.
However, the existence of this thread suggests otherwise.

regards, tom lane

#17Alvaro Herrera
alvherre@alvh.no-ip.org
In reply to: Tom Lane (#16)
Re: make update-po@master stops at pg_upgrade

On 2022-Aug-08, Tom Lane wrote:

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:

Now that I did the translation chores again after a few years I am
reminded of a point about this argument: in reality, few people ever
run this recipe manually (I know I never do), because it's easier to
grab the already-merged files from the NLS website. It all happens
mechanically and there's nobody leaving random junnk files.

Hmm, so where does the NLS website get its data?

Well, the NLS website does invoke the recipe. Just not manually.

I'd be all for flushing the recipe altogether if no one uses it.
However, the existence of this thread suggests otherwise.

I just meant it's not normally run manually. But if you do run it
manually, and you translate a file that has a few extra messages because
of the hypothetical junk source file, then you'll upload a catalog with
those extra messages; these extra messages will be dropped the next time
your file is merged through the NLS website. Maybe you'll do some extra
work (translating useless messages) but there'll be no harm.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/