Package: approx
Version: 5.2-1
Severity: normal

If pdiffs are enabled approx also tries to apply them to the
Translation-* files. Since approx only handles .gz files and the
Translation-* files seem to be only available as .bz2 this fails:

 Updating debian/dists/wheezy/main/i18n/Translation-en.gz
 Uncaught exception
   (Program not linked with -g, cannot print stack backtrace)
 Failure: decompress

After this error no further pdiffs are applied. Somehow most of the
time the Translation updates seems to be the first one tried, so that
the Packages.gz files are not updated.

The attached patch ignores all diffs inside "i18n" directories.
But a proper solution would probably also handle diffs for Translation
files and would not stop updating after the first error.

Regards,
Klaus Flittner
--- approx-5.2.orig/release.ml
+++ approx-5.2/release.ml
@@ -64,6 +64,10 @@ let is_diff_index file =
 let is_pdiff file =
   Filename.basename file <> "Index" && diff_index_dir file
 
+let is_i18n_pdiff file =
+  Filename.basename file <> "Index" && diff_index_dir file &&
+  Filename.basename (Filename.dirname (Filename.dirname file)) = "i18n"
+
 let is_i18n_index file =
   Filename.basename file = "Index" &&
   Filename.basename (Filename.dirname file) = "i18n"
--- approx-5.2.orig/release.mli
+++ approx-5.2/release.mli
@@ -32,6 +32,10 @@ val is_diff_index : string -> bool
 
 val is_pdiff : string -> bool
 
+(* Check if a file is a i18n pdiff *)
+
+val is_i18n_pdiff : string -> bool
+
 (* Check if a file is a TranslationIndex *)
 
 val is_i18n_index : string -> bool
--- approx-5.2.orig/approx.ml
+++ approx-5.2/approx.ml
@@ -391,7 +391,7 @@ let download_url url name ims cgi =
 let updates_needed = ref []
 
 let cleanup_after url file =
-  if pdiffs && Release.is_pdiff file then
+  if pdiffs && Release.is_pdiff file && not (Release.is_i18n_pdiff file) then
     (* record the affected index for later update *)
     let index = Pdiff.index_file file in
     if not (List.mem index !updates_needed) then begin

Reply via email to