Bug 115428 - i18n Makefiles do not create .mo file when the msgfmf generation failed
Summary: i18n Makefiles do not create .mo file when the msgfmf generation failed
Status: RESOLVED UNMAINTAINED
Alias: None
Product: buildsystem
Classification: Developer tools
Component: KDE3 (autotools) (show other bugs)
Version: unspecified
Platform: NetBSD pkgsrc NetBSD
: NOR normal
Target Milestone: ---
Assignee: Stephan Kulow
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-31 16:33 UTC by Antoine Reilles
Modified: 2009-08-25 03:34 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Reilles 2005-10-31 16:33:46 UTC
Version:            (using KDE KDE 3.4.3)
Installed from:    NetBSD pkgsrc
OS:                NetBSD

Some msgfmt versions fails silently and do not generate any file when encountering fuzzy .po files.

Some kde applications, like libkexif, libkipi and kipi-plugins contains such fuzzy .po files (mainly in is/ and ca/)

for instance, in libkexif, the following patch makes the libkexif.mo file to be created regardless of the msgfmt behavior:

--- po/is/Makefile.in.orig      2005-09-06 19:30:35.000000000 +0200
+++ po/is/Makefile.in
@@ -670,7 +670,7 @@ KDE_DIST=Makefile.in libkexif.po Makefil
 #>+ 4
 libkexif.gmo: libkexif.po
        rm -f libkexif.gmo; $(GMSGFMT) -o libkexif.gmo $(srcdir)/libkexif.po
-       test ! -f libkexif.gmo || touch libkexif.gmo
+       test -f libkexif.gmo || touch libkexif.gmo
 
 #>+ 3
 clean-nls:

The problem is general, and all Makefile.in files in po/*/ should be fixed. The test in the original file is obviously wrong.

Similar patches are at:
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/graphics/libkexif/patches/
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/graphics/libkipi/patches
http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/graphics/kipi-plugins/patches/

Regards,
antoine
Comment 1 Nicolas Goutte 2005-10-31 21:50:09 UTC
I think that it is more a "configure" bug than an "i18n" one, even if I do not really understand the bug yet.

Have a nice day!
Comment 2 Antoine Reilles 2005-11-01 03:57:18 UTC
On Oct 31, 2005, at 9:50 PM, Nicolas Goutte wrote:
> ------- Additional Comments From nicolasg snafu de  2005-10-31  
> 21:50 -------
> I think that it is more a "configure" bug than an "i18n" one, even  
> if I do not really understand the bug yet.

Yes, the bug is not really "i18n". I don't know how the Makefile.in  
for po/ subdirectories are generated, but the bug is probsbly related  
to how those are generated. Could it be in the *todist tools ? I  
don't know much about kde processes to create distribution

--
antoine
Comment 3 Nicolas Goutte 2005-11-01 16:40:22 UTC
On Tuesday 01 November 2005 03:57, Antoine Reilles wrote:
[bugs.kde.org quoted mail]

No, the Makefiles are either created:
- by pofiles.um of unsermake (which has not any touching of GMO files)
- by admin/am_edit (which seems to be the code that is critized here)  if you 
use automake 

Another question: what do you exactly mean by "fuzzy PO files"? Do you mean 
files where the empty msgid is marked as fuzzy? If this is really the case, 
then the real problem is not the generation of Makefiles but more than there 
are buggy PO files.

Have a nice day!


>
> --
> antoine

Comment 4 Antoine Reilles 2005-11-01 16:56:48 UTC
On Nov 1, 2005, at 4:40 PM, Nicolas Goutte wrote:
> Another question: what do you exactly mean by "fuzzy PO files"? Do  
> you mean
> files where the empty msgid is marked as fuzzy? If this is really  
> the case,
> then the real problem is not the generation of Makefiles but more  
> than there
> are buggy PO files.


Yes, those files are probably there to give a starting point for  
translators.
I don't think it is the point here.
The Makefiles generated contains entry like:

  libkexif.gmo: libkexif.po
         rm -f libkexif.gmo; $(GMSGFMT) -o libkexif.gmo $(srcdir)/ 
libkexif.po
         test ! -f libkexif.gmo || touch libkexif.gmo

the last lines purpose it to create an empty .gmo file if the msgfmt  
call did not create the file, which is the case for files with empty  
msgid. But what the test does it to touch the file if it exists, and  
not if it doesn't.
There is no necessity to touch the .gmo file if it has just been  
created by msgfmt. However, creating it even if msgfmt failed makes  
sure the rule is not trigerred each time, and also make sure the  
installed files are the same regardless if msg files have been  
updated, of the used version of msgfmt.

> No, the Makefiles are created:
> - by admin/am_edit (which seems to be the code that is critized  
> here)  if you
> use automake


so i suggest the following patch for am_edit:
--- admin/am_edit.orig  2005-09-17 18:09:28.000000000 +0200
+++ admin/am_edit
@@ -1614,7 +1614,7 @@ sub handle_POFILES($$)
          $pofile =~ /(.*)\.[^\.]*$/;          # Find name minus  
extension
          $tmp .= "$1.gmo: $pofile\n";
          $tmp .= "\trm -f $1.gmo; \$(GMSGFMT) -o $1.gmo \$(srcdir)/ 
$pofile\n";
-        $tmp .= "\ttest ! -f $1.gmo || touch $1.gmo\n";
+        $tmp .= "\ttest -f $1.gmo || touch $1.gmo\n";
          $allgmofiles .= " $1.gmo";
          $pofileLine  .= " $1.po";
      }
Comment 5 Nicolas Goutte 2005-11-01 17:15:11 UTC
On Tuesday 01 November 2005 16:56, Antoine Reilles wrote:
[bugs.kde.org quoted mail]

Well, a PO file is supposed to be a PO file. So the empty msgid should not be 
fuzzy.

To have a PO file that makes msgfmt refuse to produce a file is a bug in 
itself.

> I don't think it is the point here.


> The Makefiles generated contains entry like:
>
>   libkexif.gmo: libkexif.po
>          rm -f libkexif.gmo; $(GMSGFMT) -o libkexif.gmo $(srcdir)/
> libkexif.po
>          test ! -f libkexif.gmo || touch libkexif.gmo
>
> the last lines purpose it to create an empty .gmo file if the msgfmt
> call did not create the file, which is the case for files with empty
> msgid.


I am not sure that it was the purpose. If it was, it would have been 
introduced in unsermake too. As it is not, I suppose that its reason was 
another.

I do not think that creating empty GMO files is a good goal. It would be at 
most a hack.

(But I am not an expert of KDE's build system, neither the old automake-based 
ones, nor of the one around unsermake.)

> But what the test does it to touch the file if it exists, and
> not if it doesn't.


> There is no necessity to touch the .gmo file if it has just been
> created by msgfmt.


I would be careful. It is not the only place where there are curious touch 
calls. So perhaps there is/was really a need for it. (That would explain why 
the unsermake version of the code does not have such a call, as unsermake is 
not as touchy as the automake-based build system.)

(...)

Have a nice day!
Comment 6 Raphael Kubo da Costa 2009-08-25 03:34:26 UTC
Closing this report as the build system has changed in KDE4.