Debian Bug report logs - #502244
cdebconf: fall-back languages not working; mechanism to drop translations broken?

version graph

Package: cdebconf; Maintainer for cdebconf is Debian Install System Team <debian-boot@lists.debian.org>; Source for cdebconf is src:cdebconf.

Reported by: Frans Pop <elendil@planet.nl>

Date: Tue, 14 Oct 2008 20:42:01 UTC

Severity: serious

Tags: patch

Found in version cdebconf/0.117

Fixed in version cdebconf/0.138

Done: Frans Pop <fjp@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#502244; Package cdebconf. (Tue, 14 Oct 2008 20:42:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Frans Pop <elendil@planet.nl>:
New Bug report received and forwarded. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Tue, 14 Oct 2008 20:42:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Frans Pop <elendil@planet.nl>
To: Debian BTS Submit <submit@bugs.debian.org>
Subject: cdebconf: fall-back languages not working; mechanism to drop translations broken?
Date: Tue, 14 Oct 2008 22:40:14 +0200
[Message part 1 (text/plain, inline)]
Package: cdebconf
Version: 0.117
Severity: serious

I've tested an install from a daily i386 mini.iso booted with
'DEBCONF_DEBUG=.'. The following choices were made during installation:
- language: Northern Sami
- keymap (list is shown in English!): American English
- netcfg (dialogs are translated): default values from DHCP accepted
- choose-mirror (country list dialog is in English with countries shown
  as country codes, i.e. Choices-C values): <go back>
- main-menu (translated, except for Change debconf prio and Save logs):
  select 'Save debug logs'
- save-logs (dialog untranslated): choose 'web'

Northern Sami has a huge list of fall-back languages. The preferred 
language is se, but nb,no,nn,da,sv should all be tried before English is 
shown.

The missing translations for keymap list and save logs can be explained as 
they seem to be missing a translation for se. But why is fall-back not 
working?

The fact that C values are shown in the country list for choose-mirror 
looks to be an error in choose-mirror itself. Will file separate BR.

The debug log is very strange.
- It shows translations being dropped with "wantlang=C" immediately after
  initial loading of templates, but templates.dat shows the translations
  are still there.
- After that you get language/country selection. debconf/language is set
  to "se_NO:nb_NO:nb:no_NO:no:nn_NO:nn:da:sv:en"
- Immediately after that translations are again being dropped, this time
  with "wantlang=se". Again seemingly without effect on templates file.

How is the dropping of translations supposed to work?

The debug log was too big to attach, but can be reproduced easily.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#502244; Package cdebconf. (Tue, 28 Oct 2008 20:45:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Tue, 28 Oct 2008 20:45:05 GMT) Full text and rfc822 format available.

Message #10 received at 502244@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 502244@bugs.debian.org
Subject: LANGUAGE=se:nb:no:nn:da:sv ?
Date: Tue, 28 Oct 2008 20:44:02 +0000
[Message part 1 (text/plain, inline)]
This bug has been around for 2 weeks without comment, I'm just trying
to understand what is going on.

The mechanism in the title is certainly how fallback is meant to be
activated and I can't see anything in the cdebconf C source code that
would change that.

I don't do much with D-I so I can only think that something is wrong
with the environment:

root@dwarf:~# LANGUAGE=se:nb:no:nn:da:sv /usr/lib/cdebconf/dpkg-reconfigure dpkg-cross
Obsolete command TITLE Default cross-build architecture selection called
Default cross-build architecture selection
------------------------------------------

Om den här maskinen typiskt används för att bygga för en huvudarkitektur, kan du välja den arkitekturen här för att slippa 
ange den igen när du kör dpkg-cross, apt-cross eller emdebian-tools. Välj 'Ingen' för att inte ha något standardval.
Standardarkitektur för krossbyggnation:
  1. Ingen [*]  3. amd64      5. armeb      7. hppa      9. ia64     11. mips       13. powerpc     15. sparc    
  2. alpha      4. arm        6. armel      8. i386     10. m68k     12. mipsel     14. s390       
Prompt: '?' for help, default=1>     

root@dwarf:~# LANGUAGE=se:nb:no:nn:da /usr/lib/cdebconf/dpkg-reconfigure dpkg-cross
Obsolete command TITLE Default cross-build architecture selection called
Default cross-build architecture selection
------------------------------------------

If this machine is typically cross-building for one main architecture, you can select that architecture here to save 
specifying it again when running dpkg-cross, apt-cross or emdebian-tools. Select 'None' to have no default.
Default cross-building architecture:
  1. None [*]   3. amd64      5. armeb      7. hppa      9. ia64     11. mips       13. powerpc     15. sparc    
  2. alpha      4. arm        6. armel      8. i386     10. m68k     12. mipsel     14. s390       
Prompt: '?' for help, default=1> 

So fallback does appear to work in this respect - sv gets chosen as the
only language supported by this particular package.

root@dwarf:~# ls /opt/working/dpkg-cross/debian/po/
cs.po  CVS  de.po  fr.po  it.po  ja.po	ka.po  nl.po  POTFILES.in  pt.po  ru.po  sv.po	templates.pot  uk.po

Testing with those languages shows that the fallback mechanism does
work - at least outside D-I.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

[Message part 2 (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#502244; Package cdebconf. (Tue, 28 Oct 2008 21:21:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to 502244@bugs.debian.org:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Tue, 28 Oct 2008 21:21:05 GMT) Full text and rfc822 format available.

Message #15 received at 502244@bugs.debian.org (full text, mbox):

From: Frans Pop <elendil@planet.nl>
To: 502244@bugs.debian.org
Cc: Neil Williams <codehelp@debian.org>
Subject: Re: Bug#502244: LANGUAGE=se:nb:no:nn:da:sv ?
Date: Tue, 28 Oct 2008 22:17:33 +0100
On Tuesday 28 October 2008, Neil Williams wrote:
> I don't do much with D-I so I can only think that something is wrong
> with the environment:

Problem is that the environment cannot be changed in D-I as the language
is selected using a subshell within the environment where D-I runs.

This means that cdebconf also _has_ to respect fallback languages set in 
debconf/language.

If you look at src/commands.c it looks like LANGUAGE is supposed to be set 
from debconf/language, but for some reason that either does not include 
the fallbacks, or, if they are included correctly, they get ignored.

Hope that helps.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#502244; Package cdebconf. (Sat, 29 Nov 2008 18:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ben Hutchings <ben@decadent.org.uk>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Sat, 29 Nov 2008 18:36:03 GMT) Full text and rfc822 format available.

Message #20 received at 502244@bugs.debian.org (full text, mbox):

From: Ben Hutchings <ben@decadent.org.uk>
To: Frans Pop <elendil@planet.nl>
Cc: 502244@bugs.debian.org
Subject: Re: cdebconf: fall-back languages not working; mechanism to drop translations broken?
Date: Sat, 29 Nov 2008 18:36:19 +0000
[Message part 1 (text/plain, inline)]
Please try the following patch.

Ben.

diff -Nru cdebconf-0.137/src/template.c cdebconf-0.137+nmu1/src/template.c
--- cdebconf-0.137/src/template.c	2008-09-14 15:28:22.000000000 +0100
+++ cdebconf-0.137+nmu1/src/template.c	2008-11-29 18:32:20.000000000 +0000
@@ -530,24 +530,20 @@
              strcmp(lang, "C") == 0 || strncmp(lang, "en", 2) == 0)
         curlang = lang;
     else {
-        const char *wantlang_full = getlanguage();
-        char *wantlang;
-        char *p;
-
-        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);
-            free(wantlang);
-            return;
-        }
-        free(wantlang);
+	struct cache_list_lang *cl;
+
+	/* Could this language possibly be selected by template_lget()? */
+	getlanguage();
+	for (cl = cache_list_lang_ptr; cl != NULL; cl = cl->next)
+	    if (strcmp(cl->lang, lang) == 0 ||
+		(strlen(cl->lang) == 2 && strncmp(cl->lang, lang, 2) == 0))
+		break;
+	if (cl == NULL) {
+	    INFO(INFO_VERBOSE, "Dropping %s/%s for %s (cache_cur_lang=%s)", t->tag, field, lang, cache_cur_lang);
+	    return;
+	}
+
+	curlang = lang;
     }
 
     p = t->fields;
--- END ---

-- 
Ben Hutchings
Any smoothly functioning technology is indistinguishable from a rigged demo.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#502244; Package cdebconf. (Sat, 29 Nov 2008 22:48:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to 502244@bugs.debian.org:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Sat, 29 Nov 2008 22:48:10 GMT) Full text and rfc822 format available.

Message #25 received at 502244@bugs.debian.org (full text, mbox):

From: Frans Pop <elendil@planet.nl>
To: 502244@bugs.debian.org
Cc: Ben Hutchings <ben@decadent.org.uk>
Subject: Re: Bug#502244: cdebconf: fall-back languages not working; mechanism to drop translations broken?
Date: Sat, 29 Nov 2008 23:43:38 +0100
On Saturday 29 November 2008, Ben Hutchings wrote:
> Please try the following patch.

Thanks a lot for the patch Ben. This is actually a patch for #502240, 
which already had a patch by Jérémy Bobbio.

I have tested both patches, and it turns out that this BR is also solved 
when #502240 is solved, which does follow somewhat from my original 
analysis, but is not 100% obvious.

Apparently translations _do_ get dropped *in memory* even though that does 
not get saved to /var/lib/cdebconf/templates.dat on the ramdisk until 
anna gets run. So if you look at that file during the early stages of the 
installation, it will appear that all translations are still available, 
even when for practical purposes they are not.
If the user switches to a different language during those early stages, 
translations will get "re-dropped" in memory starting from the _full set_ 
of available translations in templates.dat.

So there is no problem with cdebconfs handling of debconf/language versus 
setting LANGUAGE.

There is one problem with Ben's patch which is not present in Jérémy's 
patch: Ben's patch will also drop se.UTF8 translations, which is 
obviously not what we want as se_NO (and thus also se) is the preferred 
language for Northern Sami.

I have got a commit ready based on Jérémy's patch with fixes for the minor 
issues identified by Colin and will commit that and upload tomorrow if 
there are no further comments.

Note that for Northern Sami this does still leave choose-mirror mostly in 
English and its country list as country codes, but as mentioned in the 
original report that is a problem in the way choose-mirror is built 
rather than in cdebconf (and can also affect other components that do 
merging of PO files during package build).

Cheers,
FJP




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Install System Team <debian-boot@lists.debian.org>:
Bug#502244; Package cdebconf. (Sun, 30 Nov 2008 08:48:34 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christian Perrier <bubulle@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <debian-boot@lists.debian.org>. (Sun, 30 Nov 2008 08:48:35 GMT) Full text and rfc822 format available.

Message #30 received at 502244@bugs.debian.org (full text, mbox):

From: Christian Perrier <bubulle@debian.org>
To: 502244@bugs.debian.org
Cc: Ben Hutchings <ben@decadent.org.uk>
Subject: Re: Bug#502244: cdebconf: fall-back languages not working; mechanism to drop translations broken?
Date: Sun, 30 Nov 2008 09:01:00 +0100
[Message part 1 (text/plain, inline)]
Quoting Frans Pop (elendil@planet.nl):

> I have got a commit ready based on Jérémy's patch with fixes for the minor 
> issues identified by Colin and will commit that and upload tomorrow if 
> there are no further comments.


I vote for it, thanks for deep investigation. I would have loved to do
it but I'm still stuck with locally built netboot images on *my*
system failing to boot properly in Virtualbox. I really need to solve
this out.

So, Frans, if you commit and upload, I can then try some wider testing
about that issue.



[signature.asc (application/pgp-signature, inline)]

Tags added: patch Request was from Ben Hutchings <ben@decadent.org.uk> to control@bugs.debian.org. (Sun, 30 Nov 2008 17:48:04 GMT) Full text and rfc822 format available.

Reply sent to Frans Pop <fjp@debian.org>:
You have taken responsibility. (Mon, 01 Dec 2008 06:27:08 GMT) Full text and rfc822 format available.

Notification sent to Frans Pop <elendil@planet.nl>:
Bug acknowledged by developer. (Mon, 01 Dec 2008 06:27:09 GMT) Full text and rfc822 format available.

Message #37 received at 502244-close@bugs.debian.org (full text, mbox):

From: Frans Pop <fjp@debian.org>
To: 502244-close@bugs.debian.org
Subject: Bug#502244: fixed in cdebconf 0.138
Date: Mon, 01 Dec 2008 06:02:03 +0000
Source: cdebconf
Source-Version: 0.138

We believe that the bug you reported is fixed in the latest version of
cdebconf, which is due to be installed in the Debian FTP archive:

cdebconf-gtk-udeb_0.138_amd64.udeb
  to pool/main/c/cdebconf/cdebconf-gtk-udeb_0.138_amd64.udeb
cdebconf-newt-udeb_0.138_amd64.udeb
  to pool/main/c/cdebconf/cdebconf-newt-udeb_0.138_amd64.udeb
cdebconf-priority_0.138_all.udeb
  to pool/main/c/cdebconf/cdebconf-priority_0.138_all.udeb
cdebconf-text-udeb_0.138_amd64.udeb
  to pool/main/c/cdebconf/cdebconf-text-udeb_0.138_amd64.udeb
cdebconf-udeb_0.138_amd64.udeb
  to pool/main/c/cdebconf/cdebconf-udeb_0.138_amd64.udeb
cdebconf_0.138.dsc
  to pool/main/c/cdebconf/cdebconf_0.138.dsc
cdebconf_0.138.tar.gz
  to pool/main/c/cdebconf/cdebconf_0.138.tar.gz
cdebconf_0.138_amd64.deb
  to pool/main/c/cdebconf/cdebconf_0.138_amd64.deb
libdebconfclient0-dev_0.138_amd64.deb
  to pool/main/c/cdebconf/libdebconfclient0-dev_0.138_amd64.deb
libdebconfclient0-udeb_0.138_amd64.udeb
  to pool/main/c/cdebconf/libdebconfclient0-udeb_0.138_amd64.udeb
libdebconfclient0_0.138_amd64.deb
  to pool/main/c/cdebconf/libdebconfclient0_0.138_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 502244@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Frans Pop <fjp@debian.org> (supplier of updated cdebconf package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 01 Dec 2008 06:41:23 +0100
Source: cdebconf
Binary: cdebconf libdebconfclient0 libdebconfclient0-dev cdebconf-udeb cdebconf-priority libdebconfclient0-udeb cdebconf-slang-udeb cdebconf-newt-udeb cdebconf-text-udeb cdebconf-gtk-udeb
Architecture: source all amd64
Version: 0.138
Distribution: unstable
Urgency: low
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Frans Pop <fjp@debian.org>
Description: 
 cdebconf   - Debian Configuration Management System (C-implementation)
 cdebconf-gtk-udeb - Gtk+ frontend for Debian Configuration Management System (udeb)
 cdebconf-newt-udeb - Newt frontend for Debian Configuration Management System (udeb)
 cdebconf-priority - Change debconf priority (udeb)
 cdebconf-slang-udeb - S-Lang frontend for Debian Configuration Management System (udeb)
 cdebconf-text-udeb - Plain text frontend for Debian Configuration Management System (udeb)
 cdebconf-udeb - Debian Configuration Management System (C-implementation) (udeb)
 libdebconfclient0 - Debian Configuration Management System (C-implementation)
 libdebconfclient0-dev - Development files for cdebconf
 libdebconfclient0-udeb - Debian Configuration Management System (C-implementation) (udeb)
Closes: 502240 502244
Changes: 
 cdebconf (0.138) unstable; urgency=low
 .
   [ Jérémy Bobbio ]
   * Do not drop translations that are defined as fall-back languages for the
     currently selected language. Closes: #502240, #502244.
Checksums-Sha1: 
 9bd2ff291de5c44c19893c44231aaae4880f2874 1351 cdebconf_0.138.dsc
 38f58b09b6aded8e73990e22fac335e549802498 309438 cdebconf_0.138.tar.gz
 3afa92fa8315b38ae9b1d35170d50c9afc31ffc8 2770 cdebconf-priority_0.138_all.udeb
 b156a9dd0276d884ac6fdebea2c237519b4a433d 169826 cdebconf_0.138_amd64.deb
 e5ccda69d1af855f0cff8f5751e00daf69492a28 38120 libdebconfclient0_0.138_amd64.deb
 5e49971579d3b0461f93de72e84d461f9a091925 43034 libdebconfclient0-dev_0.138_amd64.deb
 77f885b8998c98394a09552df496c448cc9e9703 79482 cdebconf-udeb_0.138_amd64.udeb
 cc18494e4cd57b210f955c2711fb58f412731097 3294 libdebconfclient0-udeb_0.138_amd64.udeb
 3c4b3bace2daa120db9911214e20c5972c130e85 18974 cdebconf-newt-udeb_0.138_amd64.udeb
 b5d2213babde6aca4d4ebdd09d87205dc438cc80 20198 cdebconf-text-udeb_0.138_amd64.udeb
 bba4a1fa09f665300ab970a7d59c81097a5b83f6 31332 cdebconf-gtk-udeb_0.138_amd64.udeb
Checksums-Sha256: 
 92dd2f0fdb51254f60817ad9c5d52ecbc2537e8b0a8c098ddc5ce0f56e91fe76 1351 cdebconf_0.138.dsc
 57916673843c0f25c3951deb9a08a46dff3c3d9f6095cdab6c5551276f0a37d2 309438 cdebconf_0.138.tar.gz
 2e544a3363833a71f448d570f56c8d490dc0f11cd313df0d036237b7f2a5b9c3 2770 cdebconf-priority_0.138_all.udeb
 307741b561127b6b6059f91abba9194f6ed9edf5ae70c9c9a360be1d139211d6 169826 cdebconf_0.138_amd64.deb
 b6ca4fe092afe4232599314e22810d0e4b1c1c3b0c16a491a15ff4b36b81cc6e 38120 libdebconfclient0_0.138_amd64.deb
 4f786211666c4a66f5a2b4afefd30fea6434f9517f4b75c2b29a52f40f3bfedd 43034 libdebconfclient0-dev_0.138_amd64.deb
 7ead23b76258b1cc5e783c882b35a6a481c5d0704adadff3afc44665dda00c8a 79482 cdebconf-udeb_0.138_amd64.udeb
 932c0727c3bdf088c3558bf0e7aeefd287996bca0767bca5eded4d5be5b8a5c1 3294 libdebconfclient0-udeb_0.138_amd64.udeb
 125f4771b419e187d3f89c4ea21d2330233a52d53317d05b906dd4f25694c63c 18974 cdebconf-newt-udeb_0.138_amd64.udeb
 63f8a92efa7ce1c3c3025b78ae079a942bea5a5555d95a44fafce0ce98c4ba20 20198 cdebconf-text-udeb_0.138_amd64.udeb
 1504dc8ec46de96bcf38061c5b9a047f0949ebd6402537d18a8f06e53598a1d6 31332 cdebconf-gtk-udeb_0.138_amd64.udeb
Files: 
 d6843daa6ba68f6a367c6f51d5b8be10 1351 utils optional cdebconf_0.138.dsc
 a336418c66cd93a87eb2b12a6235cc91 309438 utils optional cdebconf_0.138.tar.gz
 b3941898c89bc3aa44e4f482af181e84 2770 debian-installer standard cdebconf-priority_0.138_all.udeb
 5b9a2086f98e5ab80b1a820b32abbdd0 169826 utils extra cdebconf_0.138_amd64.deb
 388d5ad50d771dafa81db1f5eafbd873 38120 libs optional libdebconfclient0_0.138_amd64.deb
 6bd4277ca1bc53cf024a618e2f6673ec 43034 libdevel optional libdebconfclient0-dev_0.138_amd64.deb
 8e088e5badf0fbf7757662982a46128e 79482 debian-installer standard cdebconf-udeb_0.138_amd64.udeb
 1fb2139e89841073f873a483f95e230f 3294 debian-installer optional libdebconfclient0-udeb_0.138_amd64.udeb
 78340583725404cba002f2c87825a9c6 18974 debian-installer optional cdebconf-newt-udeb_0.138_amd64.udeb
 74fe8f8b29e654c3f31dbf0b3c9c73d7 20198 debian-installer optional cdebconf-text-udeb_0.138_amd64.udeb
 19b460cbab117b3c68cfad2467b2627b 31332 debian-installer optional cdebconf-gtk-udeb_0.138_amd64.udeb
Package-Type: udeb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkkzehgACgkQgm/Kwh6ICoThyACgl1L2QBhia1yaoq9RfOEoGg31
vbAAn3cefmBGL+ksa8oDJh1rkjwy0plR
=FNaf
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 18 Jan 2009 07:27:49 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 08:47:21 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.