Re: [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:39

Jonathan Nieder [off-list ref] writes:
Hmm, I had been wondering where that message came from.  Maybe the
following would help?
...
 po/git.pot: $(LOCALIZED_C)
-	$(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \
-	mv $@+ $@
+	$(QUIET_XGETTEXT)$(XGETTEXT) -ogit-tmp.pot $(XGETTEXT_FLAGS_C) $(LOCALIZED_C) && \
+	mv git-tmp.pot $@
Yeah, or "tmp-$@".

In either case, I'd prefer to see the above removed the temporary and the
target before running the command, following the idiom:

	rm -f $@+ $@ && \
        $(command that does not remove its output when killed) -o $@+ && \
        mv $@+ $@

Does xgettext leave output file specified with -o when it gets killed?  If
not, we don't have to use a temporary.  Makefiles in gitk and git-gui do
not seem to protect against it either.

Re: [PATCH v4 04/73] Makefile: "pot" target to extract messages marked for translation

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:50:39

Junio C Hamano wrote:
Does xgettext leave output file specified with -o when it gets killed?
I don't think so.  But xgettext collects output and then writes it all
in one swoop, so it's hard to provoke problems that way in practice.

The possibility that had me worried is what hat happens when we start
translating shell scripts:

	xgettext -o$@ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)
	xgettext -o$@ --add-missing $(XGETTEXT_FLAGS_SH) $(LOCALIZED_SH)
	xgettext -o$@ --add-missing $(XGETTEXT_FLAGS_PERL) $(LOCALIZED_PERL)

If the build is interrupted partway through, the output from the
commands that succeeded will remain and leave out the messages that
would have been added later out of the template.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help