[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#597925: apt-cache forgets to display some short descriptions



Hi Cyril Brulebois,

2010/9/24 Cyril Brulebois <cyril.brulebois@kerlabs.com>:
> quite surprisingly, some short descriptions aren't displayed:
> | $ LC_ALL=C apt-cache search syslog perl
[snip]
> | libsys-syslog-perl - Perl interface to the UNIX syslog(3) calls
> | libunix-syslog-perl -
> | perl -
>
> That seems to match the packages for which a French translation is
> available.

You are right, it is an issue related to the availability of translations.
apt-cache chose the first translation it could find for the patternmatching -
this is and was always (if available) a translated description thanks to
an implementation detail in the parser - so in pre-0.8 the results of
DescriptionList() and TranslatedDescription() are the same.
0.8 beaks this in two way:
- APT now can have multiple translated descriptions for different users
- APT doesn't need to rebuild the caches
The later causes that the DescriptionList() will return the fr translation -
a rebuild wouldn't have include fr in pre-0.8 - while the former doesn't
consider the fr translation a valid response as the user hasn't configured
to revise fr translations -- so while LANG=C is the most obvious case
each multilingual setup is broken in this way.

Attached is the :s/DescriptionList/TranslatedDescription/ fix.

Lets see how this fits into the APT-and-squeeze plan now…


Best regards

David Kalnischkies
=== modified file 'cmdline/apt-cache.cc'
--- cmdline/apt-cache.cc	2010-08-28 15:54:29 +0000
+++ cmdline/apt-cache.cc	2010-09-24 12:18:52 +0000
@@ -1321,7 +1321,7 @@
 	 continue;
       pkgCache::VerIterator V = Plcy->GetCandidateVer(P);
       if (V.end() == false)
-	 DFList[G->ID].Df = V.DescriptionList().FileList();
+	 DFList[G->ID].Df = V.TranslatedDescription().FileList();
 
       if (DFList[G->ID].NameMatch == false)
 	 continue;
@@ -1334,7 +1334,7 @@
 	    continue;
 
 	 unsigned long id = Prv.OwnerPkg().Group()->ID;
-	 DFList[id].Df = V.DescriptionList().FileList();
+	 DFList[id].Df = V.TranslatedDescription().FileList();
 	 DFList[id].NameMatch = true;
       }
    }

=== modified file 'debian/changelog'
--- debian/changelog	2010-09-17 20:22:50 +0000
+++ debian/changelog	2010-09-24 12:18:52 +0000
@@ -1,3 +1,12 @@
+apt (0.8.6) UNRELEASED; urgency=low
+
+  [ David Kalnischkies ]
+  * cmdline/apt-cache.cc:
+    - use the TranslatedDescription for searching and not the first
+      available one as it is maybe not an expected language (Closes: #597925)
+
+ -- David Kalnischkies <kalnischkies@gmail.com>  Fri, 24 Sep 2010 14:11:52 +0200
+
 apt (0.8.5) unstable; urgency=low
 
   [ Manpages translations ]


Reply to: