* kconfig: update-po-config broken in 2.6.29
@ 2009-04-07 18:56 Massimo Maiurana
2009-04-07 19:17 ` Sam Ravnborg
0 siblings, 1 reply; 3+ messages in thread
From: Massimo Maiurana @ 2009-04-07 18:56 UTC (permalink / raw)
To: sam; +Cc: linux-kernel
hi,
in latest 2.6.29 "make update-po-config" fails at msguniq invocation
with an "invalid control sequence" error.
the offending string is the following, and it's located in
drivers/staging/panel/Kconfig:72:
"'\e[L' which are specific to the LCD, and a few ANSI codes. The"
looks to me like gettext expects strings in printf format, so in
this case it thinks "\e" is a control sequence but doesn't recognise
it as a valid one.
I can still obtain a suitable linux.pot file escaping the backslash,
and the resulting linux.mo file works even if the string is again
unescaped, but of course if I leave the escaped string it will be
displayed as-is (with a double backslash) if i run a configurator in
english, so it is not a valid solution for a patch.
Maybe a valid solution would be to tell kxgettext to automatically
escape this kind of strings in the */config.pot he produces, so that
msguniq would not complain?... I don't really know, and I don't even
know how to do it. I see there is an escape function right at the
top of kxgettext.c, but as I'm not a coder I don't really know how
to hack it, so it's up to you... sorry.
--
Massimo Maiurana massimo<at>ragusa.linux.it
http://massimo.solira.org GPG keyID #7044D601
Articolo 33 - [...]Enti e privati hanno il diritto di istituire
scuole ed istituti di educazione, senza oneri per lo Stato.[...]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: kconfig: update-po-config broken in 2.6.29
2009-04-07 18:56 kconfig: update-po-config broken in 2.6.29 Massimo Maiurana
@ 2009-04-07 19:17 ` Sam Ravnborg
2009-04-07 19:39 ` Massimo Maiurana
0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2009-04-07 19:17 UTC (permalink / raw)
To: Massimo Maiurana; +Cc: linux-kernel
On Tue, Apr 07, 2009 at 08:56:36PM +0200, Massimo Maiurana wrote:
> hi,
> in latest 2.6.29 "make update-po-config" fails at msguniq invocation
> with an "invalid control sequence" error.
> the offending string is the following, and it's located in
> drivers/staging/panel/Kconfig:72:
> "'\e[L' which are specific to the LCD, and a few ANSI codes. The"
>
> looks to me like gettext expects strings in printf format, so in
> this case it thinks "\e" is a control sequence but doesn't recognise
> it as a valid one.
>
> I can still obtain a suitable linux.pot file escaping the backslash,
> and the resulting linux.mo file works even if the string is again
> unescaped, but of course if I leave the escaped string it will be
> displayed as-is (with a double backslash) if i run a configurator in
> english, so it is not a valid solution for a patch.
>
> Maybe a valid solution would be to tell kxgettext to automatically
> escape this kind of strings in the */config.pot he produces, so that
> msguniq would not complain?... I don't really know, and I don't even
> know how to do it. I see there is an escape function right at the
> top of kxgettext.c, but as I'm not a coder I don't really know how
> to hack it, so it's up to you... sorry.
Seems like a simple solution - thank for analyzing it!
Could you try following (untested) patch and see if that works
for you.
Thanks,
Sam
diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
index 6eb72a7..8d9ce22 100644
--- a/scripts/kconfig/kxgettext.c
+++ b/scripts/kconfig/kxgettext.c
@@ -43,6 +43,10 @@ static char *escape(const char* text, char *bf, int len)
++text;
goto next;
}
+ else if (*text == '\\') {
+ *bfp++ = '\\';
+ len--;
+ }
*bfp++ = *text++;
next:
--len;
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: kconfig: update-po-config broken in 2.6.29
2009-04-07 19:17 ` Sam Ravnborg
@ 2009-04-07 19:39 ` Massimo Maiurana
0 siblings, 0 replies; 3+ messages in thread
From: Massimo Maiurana @ 2009-04-07 19:39 UTC (permalink / raw)
To: Sam Ravnborg; +Cc: linux-kernel
Sam Ravnborg, il 07/04/2009 21:17, scrisse:
> On Tue, Apr 07, 2009 at 08:56:36PM +0200, Massimo Maiurana wrote:
>> hi,
>> in latest 2.6.29 "make update-po-config" fails at msguniq invocation
>> with an "invalid control sequence" error.
>> the offending string is the following, and it's located in
>> drivers/staging/panel/Kconfig:72:
>> "'\e[L' which are specific to the LCD, and a few ANSI codes. The"
>>
>> looks to me like gettext expects strings in printf format, so in
>> this case it thinks "\e" is a control sequence but doesn't recognise
>> it as a valid one.
>>
>> I can still obtain a suitable linux.pot file escaping the backslash,
>> and the resulting linux.mo file works even if the string is again
>> unescaped, but of course if I leave the escaped string it will be
>> displayed as-is (with a double backslash) if i run a configurator in
>> english, so it is not a valid solution for a patch.
>>
>> Maybe a valid solution would be to tell kxgettext to automatically
>> escape this kind of strings in the */config.pot he produces, so that
>> msguniq would not complain?... I don't really know, and I don't even
>> know how to do it. I see there is an escape function right at the
>> top of kxgettext.c, but as I'm not a coder I don't really know how
>> to hack it, so it's up to you... sorry.
> Seems like a simple solution - thank for analyzing it!
>
> Could you try following (untested) patch and see if that works
> for you.
>
> Thanks,
> Sam
>
> diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
> index 6eb72a7..8d9ce22 100644
> --- a/scripts/kconfig/kxgettext.c
> +++ b/scripts/kconfig/kxgettext.c
> @@ -43,6 +43,10 @@ static char *escape(const char* text, char *bf, int len)
> ++text;
> goto next;
> }
> + else if (*text == '\\') {
> + *bfp++ = '\\';
> + len--;
> + }
> *bfp++ = *text++;
> next:
> --len;
>
yes, your patch works as it should, i.e. the backslash get escaped
and msguniq doesn't say a word :)
many thanks, sam.
--
Massimo Maiurana massimo<at>ragusa.linux.it
http://massimo.solira.org GPG keyID #7044D601
Articolo 33 - [...]Enti e privati hanno il diritto di istituire
scuole ed istituti di educazione, senza oneri per lo Stato.[...]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-04-07 20:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-07 18:56 kconfig: update-po-config broken in 2.6.29 Massimo Maiurana
2009-04-07 19:17 ` Sam Ravnborg
2009-04-07 19:39 ` Massimo Maiurana
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.