Bug#502240: cdebconf: should not drop fall-back languages

2008-10-17 Thread Otavio Salvador
Jérémy Bobbio [EMAIL PROTECTED] writes:

 tags 502240 + patch
 thanks

 On Tue, Oct 14, 2008 at 09:39:36PM +0200, Frans Pop wrote:
 When localechooser sets debconf/language to a set of languages (preferred 
 + fall-back languages, e.g. se_NO:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en for 
 Northern Sami), cdebconf should ensure that *all* relevant translations 
 are kept when translations are dropped with DEBCONF_DROP_TRANSLATIONS 
 set.

 Indeed, cdebconf was only keeping translation for the first language
 of the set.

 The attached patch should fix this, but as I am currently lacking a
 proper environment to do a full d-i test, it would be great if someone
 could verify that it really fixes the issue.

I've did an installation using your patch and it looks to solve
it. Could you commit it? Want me to upload cdebconf or you can take
care of it?

-- 
O T A V I OS A L V A D O R
-
 E-mail: [EMAIL PROTECTED]  UIN: 5906116
 GNU/Linux User: 239058 GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
-
Microsoft sells you Windows ... Linux gives
 you the whole house.



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#502240: cdebconf: should not drop fall-back languages

2008-10-17 Thread Otavio Salvador
Otavio Salvador [EMAIL PROTECTED] writes:

 Jérémy Bobbio [EMAIL PROTECTED] writes:

 tags 502240 + patch
 thanks

 On Tue, Oct 14, 2008 at 09:39:36PM +0200, Frans Pop wrote:
 When localechooser sets debconf/language to a set of languages (preferred 
 + fall-back languages, e.g. se_NO:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en for 
 Northern Sami), cdebconf should ensure that *all* relevant translations 
 are kept when translations are dropped with DEBCONF_DROP_TRANSLATIONS 
 set.

 Indeed, cdebconf was only keeping translation for the first language
 of the set.

 The attached patch should fix this, but as I am currently lacking a
 proper environment to do a full d-i test, it would be great if someone
 could verify that it really fixes the issue.

 I've did an installation using your patch and it looks to solve
 it. Could you commit it? Want me to upload cdebconf or you can take
 care of it?

Bellow goes the comments done by Colin at #debian-boot, for reference.

18:38 cjwatson Lunar^: it looks fine except that you leak wantlang on the 
break path
18:39 cjwatson Lunar^: and I would suggest moving the char *wantlang 
declaration into the for loop to make its scope clear
18:39 cjwatson (which avoids having to think can wantlang be used outside 
this loop?
18:39 cjwatson )

-- 
O T A V I OS A L V A D O R
-
 E-mail: [EMAIL PROTECTED]  UIN: 5906116
 GNU/Linux User: 239058 GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
-
Microsoft sells you Windows ... Linux gives
 you the whole house.



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#502240: cdebconf: should not drop fall-back languages

2008-10-16 Thread Jérémy Bobbio
tags 502240 + patch
thanks

On Tue, Oct 14, 2008 at 09:39:36PM +0200, Frans Pop wrote:
 When localechooser sets debconf/language to a set of languages (preferred 
 + fall-back languages, e.g. se_NO:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en for 
 Northern Sami), cdebconf should ensure that *all* relevant translations 
 are kept when translations are dropped with DEBCONF_DROP_TRANSLATIONS 
 set.

Indeed, cdebconf was only keeping translation for the first language
of the set.

The attached patch should fix this, but as I am currently lacking a
proper environment to do a full d-i test, it would be great if someone
could verify that it really fixes the issue.

Cheers,
-- 
Jérémy Bobbio.''`. 
[EMAIL PROTECTED]: :Ⓐ  :  # apt-get install anarchism
`. `'` 
  `-   
diff --git a/packages/cdebconf/src/template.c b/packages/cdebconf/src/template.c
index dd8240a..de93b65 100644
--- a/packages/cdebconf/src/template.c
+++ b/packages/cdebconf/src/template.c
@@ -466,7 +466,7 @@ void template_lset(struct template *t, const char *lang,
 char *orig_field;
 char *altlang;
 char *cp;
-const char *curlang;
+const char *curlang = NULL;
 
 if (strcasecmp(field, tag) == 0)
 {
@@ -530,24 +530,26 @@ void template_lset(struct template *t, const char *lang,
  strcmp(lang, C) == 0 || strncmp(lang, en, 2) == 0)
 curlang = lang;
 else {
-const char *wantlang_full = getlanguage();
 char *wantlang;
 char *p;
+struct cache_list_lang *cl;
 
-if (!wantlang_full)
-wantlang_full = C;
-wantlang = strdup(wantlang_full);
-p = strpbrk(wantlang, _.@);
-if (p)
-*p = '\0';
-if (strncmp(lang, wantlang, strlen(wantlang)) == 0)
-curlang = lang;
-else {
-INFO(INFO_VERBOSE, Dropping %s/%s for %s (wantlang=%s), t-tag, field, lang, wantlang);
+getlanguage();
+for (cl = cache_list_lang_ptr; cl != NULL; cl = cl-next) {
+wantlang = strdup(cl-lang);
+p = strpbrk(wantlang, _.@);
+if (p)
+*p = '\0';
+if (strncmp(lang, wantlang, strlen(wantlang)) == 0) {
+curlang = lang;
+break;
+}
 free(wantlang);
+}
+if (curlang == NULL) {
+INFO(INFO_VERBOSE, Dropping %s/%s for %s, t-tag, field, lang);
 return;
 }
-free(wantlang);
 }
 
 p = t-fields;


signature.asc
Description: Digital signature


Bug#502240: cdebconf: should not drop fall-back languages

2008-10-14 Thread Frans Pop
Package: cdebconf
Version: 0.117
Severity: important

When localechooser sets debconf/language to a set of languages (preferred 
+ fall-back languages, e.g. se_NO:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en for 
Northern Sami), cdebconf should ensure that *all* relevant translations 
are kept when translations are dropped with DEBCONF_DROP_TRANSLATIONS 
set.

If that is not done users for languages for which translations are 
incomplete, but which do have good fall-backs set will not get the best 
possible language displayed for any installation step after anna.

I'm not sure whether this should be qualified as RC or not...


signature.asc
Description: This is a digitally signed message part.


Bug#502240: cdebconf: should not drop fall-back languages

2008-10-14 Thread Christian Perrier
Quoting Frans Pop ([EMAIL PROTECTED]):
 Package: cdebconf
 Version: 0.117
 Severity: important
 
 When localechooser sets debconf/language to a set of languages (preferred 
 + fall-back languages, e.g. se_NO:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en for 
 Northern Sami), cdebconf should ensure that *all* relevant translations 
 are kept when translations are dropped with DEBCONF_DROP_TRANSLATIONS 
 set.
 
 If that is not done users for languages for which translations are 
 incomplete, but which do have good fall-backs set will not get the best 
 possible language displayed for any installation step after anna.

Nice catch

 
 I'm not sure whether this should be qualified as RC or not...

I would say it is. We warn these users that they will see fallback
languages and they don't

-- 




signature.asc
Description: Digital signature