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

Bug#657557: [PATCH] Alternate patch for missing long descriptions

Package: www.debian.org
Followup-For: Bug #657557


Cyril and I disagree about the cause for the missing description and
the fix for it. So someone impartial please look over both out patches
and see which makes more sense. In both cases the english translations
must be added to ddtplangs [Patch 1/4] from Cyril [1], I didn't
want to repost that.

Here is how I see the problem:

1) Originaly Packages.bz2 contained the long description and no
   description-md5 field (still does for older releases).
2) Translations are indexed by the md5 of the original long description.
3) bin/parse-packages computes description-md5 and stores it in the
   packages database.
4) When generating the webpages the description-md5 is used to lookup
   the translated description with fallback to english and the
   original description.

But in sid the Packages.bz2 files now contain a description-md5 field
and only the short description instead of the short and long
description. This cause the computation in (3) above to compute the
md5sum of only the short description and then the translation lookup
in (4) fails to find a translation and falls back to the original
description, which is only the short description.

Now my patch (attached) fixes this problem by only computing the
description-md5 field if it is missing in Packages.bz2. A simple one
line fix. The rest of the code already does all the right things and
looks up the translation correclty including falling back to 'en' as
needed. E.g.:

----------------- http://localhost/sid/gcc ---------------------------
Package: gcc (4:4.6.2-4) 

GNU C compiler

This is the GNU C compiler, a fairly portable optimizing compiler for C.

This is a dependency package providing the default GNU C compiler.

Tags: Software Development: Compiler, C Development, User Interface: interface::commandline, role::metapackage, Role: Program, Application Suite: suite::gnu, works-with::software:source
Other Packages Related to gcc
----------------- http://localhost/de/sid/gcc ------------------------
Paket: gcc (4:4.6.2-4) 

Der GNU-C-Compiler

Dies ist der GNU-C-Compiler, ein recht portabler, optimierender C-Compiler.

Dies ist ein Abhängigkeitspaket, welches den Standard-GNU-C-Compiler zur Verfügung stellt.

Markierungen: Software-Entwicklung: Compiler, C-Entwicklung, Benutzer-Schnittstellen: interface::commandline, role::metapackage, Rolle: Programm, Anwendungs-Suite: suite::gnu, works-with::software:source
Andere Pakete mit Bezug zu gcc
------------------ http://localhost/de/sid/3depict ------------------
Paket: 3depict (0.0.9-1 und andere) 

visualisation and analysis for single valued point data

This program provides a graphical interface for the scientific analysis of real valued point data (x,y,z,value). This is primarily targeted towards Atom probe tomography applications, but may prove useful to other applications as well.

Markierungen: Benutzer-Schnittstellen: X-Window-System, Rolle: Programm, GUI-Baukasten: wxWidgets, Zweck: use::analysing, x11::application
Andere Pakete mit Bezug zu 3depict

3depict has no german translation so the english "translation" is used
as it should.

Correct me if I'm wrong but here is how I understand Cyrils patch: It
works by fixing the symptom instead of the problem. In [PATCH 2/4] it
checks if the Packages.bz2 file contains an description-md5 field, If
so it looks up the english translation for the package and replaces
the description with the english translation, thereby restoring the
long description for the package (line 146 with his patch). And now
that the long description has been restored the computation of
description-md5 a few lines later computes to the right value, the one
that is already present. And with the right description-md5 value the
translation lookup when generating the pages functions again. [PATCH
3/4] and [PATCH 4/4] then tidy things up and make it possible to do an
english only run for bin/parse-translations. The reason for this is
that with his patch bin/parse-packages requires an in-sync translation
database to function.


1) http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=657557#29

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.1.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1)
Shell: /bin/sh linked to /bin/dash
diff --git a/bin/parse-packages b/bin/parse-packages
index a1c8d98..1cb2075 100755
--- a/bin/parse-packages
+++ b/bin/parse-packages
@@ -142,7 +142,7 @@ for my $suite (@SUITES) {
 			$descriptions[$did] = $descr;
 			$descriptions{$descr} = $did;
-		$data{'description-md5'} = Digest::MD5::md5_hex($data{'description'}, "\n");
+		$data{'description-md5'} = Digest::MD5::md5_hex($data{'description'}, "\n") if (!exists($data{'description-md5'}));
 		$data{'description'} = $did;
 		$packages_descriptions{"$data{'package'} $data{'version'} $data{'architecture'}"} = $did;
 		$descriptions_packages{$did} .=

Reply to: