On Tue, Oct 22, 2019 at 11:11:58AM +0100, Daniel P. Berrangé wrote:
On Mon, Oct 21, 2019 at 10:00:37AM +0200, Pavel Hrdina wrote:
> Historically we did not support VPATH builds and everything was
> generated into source directory. The introduction of VPATH builds
> did not changed the way how our translation files are handled.
>
> This patch changes the rules to generate everything into build
> directory and stops distributing generated files in order to have
> properly separated VPATH builds.
>
> Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
> ---
> po/Makefile.am | 35 +++++++++++++++++++++--------------
> 1 file changed, 21 insertions(+), 14 deletions(-)
>
> diff --git a/po/Makefile.am b/po/Makefile.am
> index b0e2c15d44..8ddb1432f0 100644
> --- a/po/Makefile.am
> +++ b/po/Makefile.am
> @@ -16,17 +16,16 @@ LANGS := \
>
>
> POTFILE_DEPS := $(shell $(SED) 's,^,$(top_srcdir)/,' $(srcdir)/POTFILES)
> -POTFILE := $(srcdir)/$(DOMAIN).pot
> -POFILES := $(LANGS:%=$(srcdir)/%.po)
> -GMOFILES := $(LANGS:%=$(srcdir)/%.gmo)
> +POTFILE := $(DOMAIN).pot
> +POMINIFILES := $(LANGS:%=%.mini.po)
> +POFILES := $(LANGS:%=%.po)
> +GMOFILES := $(LANGS:%=%.gmo)
>
> -MAINTAINERCLEANFILES = $(POTFILE) $(POFILES) $(GMOFILES)
> +CLEANFILES = $(POTFILE) $(POFILES) $(GMOFILES)
>
> EXTRA_DIST = \
> POTFILES \
> - $(POTFILE) \
> - $(POFILES) \
> - $(GMOFILES)
> + $(POMINIFILES)
>
> if HAVE_GNU_GETTEXT_TOOLS
>
> @@ -63,10 +62,18 @@ update-mini-po: $(POTFILE)
> done
>
> push-pot: $(POTFILE)
> - zanata push --push-type=source
> + zanata-cli push \
> + --project-config $(srcdir)/zanata.xml \
> + --push-type=source \
> + --trans-dir $(builddir) \
> + --src-dir $(srcdir)
>
> pull-po: $(POTFILE)
> - zanata pull --create-skeletons
> + zanata-cli pull \
> + --project-config $(srcdir)/zanata.xml \
> + --create-skeletons \
> + --trans-dir $(builddir) \
> + --src-dir $(srcdir)
> $(MAKE) update-mini-po
> $(MAKE) update-gmo
This is not right. The *.mini.po files must always be created
in the src dir when we pull from zanata, becasue they're going to
be committed to git from there.
Only the non-mini *.po , *gmo and libvirt.pot files can be in
the build dir.
It should actually work like that. If you check the update-mini-po rule
it still uses $(srcdir)/$$lang.mini.po as an output file. Only
generated po and gmo files are in build directory.
Pavel