[libvirt] [PATCH v4 07/20] [ACKED] po: rewrite the way how we generate files

Daniel P. Berrangé berrange at redhat.com
Fri Nov 22 14:19:41 UTC 2019


On Fri, Nov 08, 2019 at 04:42:08PM +0100, Pavel Hrdina wrote:
> There was no need to handle files for translation from build directory
> but that will change with following patches where we will stop
> generating source files into source directory.
> 
> In order to have them included for translation we have to prefix each
> file with SRCDIR or BUILDDIR.
> 
> Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
> 
> Notes:
>     Changes in v2:
>         - add builddir paths for sc_po_check to detect generated source
>           files and generate correct diff if the check fails
> 
>  build-aux/syntax-check.mk |   8 +-
>  po/Makefile.am            |  14 +-
>  po/POTFILES               | 352 --------------------------------------
>  po/POTFILES.in            | 352 ++++++++++++++++++++++++++++++++++++++
>  4 files changed, 367 insertions(+), 359 deletions(-)
>  delete mode 100644 po/POTFILES
>  create mode 100644 po/POTFILES.in


> diff --git a/po/Makefile.am b/po/Makefile.am
> index 89e831f839..443d8a4dc1 100644
> --- a/po/Makefile.am
> +++ b/po/Makefile.am
> @@ -15,16 +15,21 @@ LANGS := \
>  	uk ur vi wba yo zh_CN zh_HK zh_TW zu
>  
>  
> -POTFILE_DEPS := $(shell $(SED) 's,^,$(top_srcdir)/,' $(srcdir)/POTFILES)
> +POTFILES_IN = $(srcdir)/POTFILES.in
> +POTFILES: $(POTFILES_IN)
> +	$(AM_V_GEN) cat $(POTFILES_IN) | \
> +		$(SED) 's|[@]SRCDIR[@]|$(top_srcdir)|' | \
> +		$(SED) 's|[@]BUILDDIR[@]|$(top_builddir)|' > $@
> +POTFILE_DEPS = $(shell cat POTFILES)

We've got a chicken & egg problem here.

Previously POTFILES was committed to git, so it always existed.

Now POTFILES.in is in git and POTFILES is generated.

When you run make we get a message

   cat: POTFILES: No such file or directory

Fortunately this is harmless AFAICT, make just continues with
an empty POTFILES_DEPS variable and the lack of deps is not
a problem since POTFILES doesn't exist yet.

I wonder if we should try to fix it though ?


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list