[libvirt] [PATCH] spec: Let translations be properly updated

Libvirt tarball contains po/stamp-po file which prevents any po/*.gmo file to be regenerated even if a corresponding po/*.po file is newer. By removing the stamp-po file, all *.gmo files are properly updated if required. This allows downstreams to provide patches that update translations. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- libvirt.spec.in | 1 + 1 file changed, 1 insertion(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 014fe5d..23374e7 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1421,6 +1421,7 @@ driver autoreconf -if %endif +rm -f po/stamp-po %configure %{?_without_xen} \ %{?_without_qemu} \ %{?_without_openvz} \ -- 1.9.0

On 03/06/2014 04:06 AM, Jiri Denemark wrote:
Libvirt tarball contains po/stamp-po file which prevents any po/*.gmo file to be regenerated even if a corresponding po/*.po file is newer. By removing the stamp-po file, all *.gmo files are properly updated if required. This allows downstreams to provide patches that update translations.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- libvirt.spec.in | 1 + 1 file changed, 1 insertion(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 014fe5d..23374e7 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1421,6 +1421,7 @@ driver autoreconf -if %endif
I think you need to guard this:
%if 0%{?enable_autotools}
+rm -f po/stamp-po %endif
%configure %{?_without_xen} \ %{?_without_qemu} \ %{?_without_openvz} \
since regeneration of .po files only occurs if autotools are re-run. When building an rpm from a stock tarball, you do NOT want to require gettext to be present - it is only when you are applying downstream patches that a .po file will ever be newer to require the regeneration of translations. ACK with the conditional added -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Mar 06, 2014 at 06:20:37 -0700, Eric Blake wrote:
On 03/06/2014 04:06 AM, Jiri Denemark wrote:
Libvirt tarball contains po/stamp-po file which prevents any po/*.gmo file to be regenerated even if a corresponding po/*.po file is newer. By removing the stamp-po file, all *.gmo files are properly updated if required. This allows downstreams to provide patches that update translations.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- libvirt.spec.in | 1 + 1 file changed, 1 insertion(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 014fe5d..23374e7 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1421,6 +1421,7 @@ driver autoreconf -if %endif
I think you need to guard this:
%if 0%{?enable_autotools}
+rm -f po/stamp-po %endif
I don't think so.
%configure %{?_without_xen} \ %{?_without_qemu} \ %{?_without_openvz} \
since regeneration of .po files only occurs if autotools are re-run.
If additional patches just update *.po and other source files without touching Makefile.am and configure.ac, there's no need to re-run autotools while we still want to regenerate gmo files from the updated po files.
When building an rpm from a stock tarball, you do NOT want to require gettext to be present - it is only when you are applying downstream patches that a .po file will ever be newer to require the regeneration of translations.
gettext is an unconditional BuildRequires in libvirt.spec so we always require it to be present (unlike gettext-devel which is only required if enable_autotools is 1). And msgfmt used for generating gmo files from po files is present in gettext package. And the Makefile from gettext is clever enough not to regenerate gmo files if their corresponding po files were not updated even if stamp-po is missing. That said, I don't really understand why stamp-po exists at all :-) Jirka

On 03/06/2014 06:37 AM, Jiri Denemark wrote:
On Thu, Mar 06, 2014 at 06:20:37 -0700, Eric Blake wrote:
On 03/06/2014 04:06 AM, Jiri Denemark wrote:
Libvirt tarball contains po/stamp-po file which prevents any po/*.gmo file to be regenerated even if a corresponding po/*.po file is newer. By removing the stamp-po file, all *.gmo files are properly updated if required. This allows downstreams to provide patches that update translations.
I think you need to guard this:
%if 0%{?enable_autotools}
+rm -f po/stamp-po %endif
I don't think so.
gettext is an unconditional BuildRequires in libvirt.spec so we always require it to be present (unlike gettext-devel which is only required if enable_autotools is 1). And msgfmt used for generating gmo files from po files is present in gettext package.
Fair enough. ACK to your patch as-is, then.
And the Makefile from gettext is clever enough not to regenerate gmo files if their corresponding po files were not updated even if stamp-po is missing. That said, I don't really understand why stamp-po exists at all :-)
It exists for incremental development - so that 'make' doesn't rebuild .gmo files for every source change. I don't know why automake packages it in the tarball, but that's a question for automake people (I'm not as familiar with automake internals as I am with autoconf). -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Mar 06, 2014 at 06:57:14 -0700, Eric Blake wrote:
On 03/06/2014 06:37 AM, Jiri Denemark wrote:
On Thu, Mar 06, 2014 at 06:20:37 -0700, Eric Blake wrote:
On 03/06/2014 04:06 AM, Jiri Denemark wrote:
Libvirt tarball contains po/stamp-po file which prevents any po/*.gmo file to be regenerated even if a corresponding po/*.po file is newer. By removing the stamp-po file, all *.gmo files are properly updated if required. This allows downstreams to provide patches that update translations.
I think you need to guard this:
%if 0%{?enable_autotools}
+rm -f po/stamp-po %endif
I don't think so.
gettext is an unconditional BuildRequires in libvirt.spec so we always require it to be present (unlike gettext-devel which is only required if enable_autotools is 1). And msgfmt used for generating gmo files from po files is present in gettext package.
Fair enough. ACK to your patch as-is, then.
OK, pushed. Thanks, Jirka
participants (2)
-
Eric Blake
-
Jiri Denemark