After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 338423 - intltool should support po/LINGUAS string spanning multiple lines
intltool should support po/LINGUAS string spanning multiple lines
Status: RESOLVED NOTGNOME
Product: intltool
Classification: Deprecated
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Rodney Dawes
intltool maintainers
: 338318 338414 338415 338416 339130 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-04-14 05:59 UTC by Behdad Esfahbod
Modified: 2006-04-20 11:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Behdad Esfahbod 2006-04-14 05:59:44 UTC
Not sure if this is a new regression or have been there for a long time, but just recently many modules started breaking with unterminated 's' command sed error.  Probably because the same translator started adding translations to all those modules.  Anyway, would be nice to handle it.
Comment 1 Behdad Esfahbod 2006-04-14 06:00:22 UTC
*** Bug 338414 has been marked as a duplicate of this bug. ***
Comment 2 Behdad Esfahbod 2006-04-14 06:27:54 UTC
Just confirmed it happens with intltool from CVS only.
Comment 3 Behdad Esfahbod 2006-04-14 06:28:25 UTC
*** Bug 338318 has been marked as a duplicate of this bug. ***
Comment 4 Behdad Esfahbod 2006-04-14 06:30:05 UTC
*** Bug 338415 has been marked as a duplicate of this bug. ***
Comment 5 Christian Kirbach 2006-04-14 10:10:14 UTC
many have seen this. confirming report.
Comment 6 Elijah Newren 2006-04-14 15:05:11 UTC
*** Bug 338416 has been marked as a duplicate of this bug. ***
Comment 7 Rodney Dawes 2006-04-14 15:49:09 UTC
This is actually an issue with autoconf and/or sed, and not intltool. All the new intltool does differently at configure-time is that it calls AC_SUBST(ALL_LINGUAS), so that the resulting po/Makefile can use the values provided there, rather than in po/LINGUAS, in the event that ALL_LINGUAS is still being used.

Any variable which contains newlines within a quoted string, that is subsequently AC_SUBST()ed, should cause this. The macros in intltool.m4 do not do any direct manipulation of the ALL_LINGUAS variable.
Comment 8 Behdad Esfahbod 2006-04-14 17:51:18 UTC
It's not only with ALL_LINGUAS, it's happening with po/LINGUAS too.  I think they should be both handled.
Comment 9 Elijah Newren 2006-04-14 18:09:11 UTC
Is the problem that both exist, i.e. that the original instructions for the Gnome Goal should be considered wrong and thus all the accepted patches are what broke things?
Comment 10 Behdad Esfahbod 2006-04-14 18:13:18 UTC
Oh, that's possible, right.
The modules I see were broken all were reading po/LINGUAS in configure.    So maybe just proceeding with the new instructions is enough.
Comment 11 Rodney Dawes 2006-04-14 18:18:30 UTC
OK. So, here's the thing. The configure.{ac,in} file is not a special data file like an XML description of things, or anything. It is a shell script. And you cannot use multi-line values for variables without escaping the newline. I can handle this for po/LINGUAS, as it is a data file that gets read in. I cannot change how bash interprets the configure script though. If you want to use newlines in variables in configure.{in,ac} or Makefiles, you must escape the newline with the \ character, just as is done for foo_SOURCES and other variables.

I'm updating the summary to reflect the problem in po/LINGUAS, but the ALL_LINGUAS issue needs to be fixed properly in the applications, or by converting to po/LINGUAS, and dropping the use of ALL_LINGUAS completely. I'll fix the po/LINGUAS part later today.
Comment 12 Behdad Esfahbod 2006-04-14 18:26:14 UTC
I don't think it's that hard to fix dobey.  All you need to do is to remove the newlines (convert to spaces) from ALL_LINGUAS before AC_SUBSTing it.

Not sure what the portable way to do that is, but tr '\n' ' ' works for example.
Comment 13 Rodney Dawes 2006-04-14 19:28:23 UTC
AC_SUBST is not an intltool macro. And ALL_LINGUAS is NOT the only variable where this problem could occur. The correct way would be to s/$/\\/ on the variable, assuming the whole variable actually gets read in and is available to whatever does that. If that is what needs to be done, it needs to be done in autoconf, not in intltool. However, I presume that the autoconf hackers will tell you that you need to write proper shell in your configure script, as it is a shell script.

I don't remember if I made it prefer the ALL_LINGUAS or po/LINGUAS method in Makefile.in.in. I'll look at it later, when I fix the handling of newlines in po/LINGUAS, and test a few more things, to make sure we at least avoid this situation.
Comment 14 Behdad Esfahbod 2006-04-14 19:35:09 UTC
If it's that you just don't want to fix it, I would be happy to just hear that.  If you are willing to fix but don't know how, I will be happy to submit a patch, but what you wrote doesn't make much sense to me.  I perfectly know how shell script, autoconf, and m4 works, and FWIW shell variables with newlines are perfectly valid.   Intltool can very easily remove newlines from ALL_LINGUAS before passing it to AC_SUBST.  Yes, you can do that even though AC_SUBST is not an intltool macro.  I just cannot imagine how that can even matter...
Comment 15 Rodney Dawes 2006-04-15 02:42:35 UTC
It's not that I want to fix it or don't know how. However, I am not going to put a hack into intltool to workaround a problem that exists in far more potential situations than just the use of ALL_LINGUAS.

If I create some other variable, that contains newlines, and I need to AC_SUBST() it, so that I may use it in a Makefile, where should I point the blame for that, when it causes the exact same problem you are stating here? Putting a workaround in intltool for this one case isn't fixing the problem, it's fixing a symptom, and I won't do that.
Comment 16 Rodney Dawes 2006-04-15 19:05:10 UTC
OK, So, intltool works fine already with po/LINGUAS having each locale on a separate line. The applications that the recently committed changes expose this  issue with the sed failure in, need to be fixed properly. What is to prevent this occuring by some other means than AC_SUBST(ALL_LINGUAS) in thos applications? The only way you are going to be able to fix this, is to fix autoconf to properly handle newlines in the substitution of variables which get passed to sed. The script pasted below, will also exhibit this error. The sed program does not handle straight newlines in substitutions. So, I am marking this as NOTGNOME and refusing to workaround bad code by trying to automatically fix it. Please fix the applications properly.

-----------------------------
#!/bin/sh

FOO="BAR
 BAZ"

echo "FOO = @FOO@" | sed -e "s/\@FOO\@/${FOO}/"
Comment 17 Rodney Dawes 2006-04-20 11:37:09 UTC
*** Bug 339130 has been marked as a duplicate of this bug. ***