[Apt-offline-devel] [SCM] Offline APT Package Manager branch, master, updated. 0.9.5-19-g2b1fdf4

Ritesh Raj Sarraf rrs at researchut.com
Tue Dec 8 10:50:20 UTC 2009


The following commit has been merged in the master branch:
commit 7fbdf60b6201b582f8fff66920ff6232e383d654
Author: Ritesh Raj Sarraf <rrs at researchut.com>
Date:   Thu Dec 3 22:48:58 2009 +0530

    Simply discard damaged bzip2 files
    
    rrs at champaran:/tmp $ bunzip2 rrs.bz2
    
    bunzip2: Data integrity error when decompressing.
            Input file = rrs.bz2, output file = rrs
    
    It is possible that the compressed file(s) have become corrupted.
    You can use the -tvv option to test integrity of such files.
    
    You can use the `bzip2recover' program to attempt to recover
    data from undamaged sections of corrupted files.
    
    bunzip2: Deleting output file rrs, if it exists.
    rrs at champaran:/tmp $ bunzip2 -tvv rrs.bz2
      rrs.bz2:
        [1: huff+mtf data integrity (CRC) error in data
    
    You can use the `bzip2recover' program to attempt to recover
    data from undamaged sections of corrupted files.
    
    ================
    
    Since the source bzip2 archive file itself is downloaded in damaged
    form, there is very little apt-offline can do here.
    Safest bet at the moment looks like we should just simply discard the
    damaged data file.

diff --git a/AptOfflineLib.py b/AptOfflineLib.py
index b2f874a..6ec94e3 100644
--- a/AptOfflineLib.py
+++ b/AptOfflineLib.py
@@ -351,6 +351,12 @@ class Archiver:
                 except IOError:
                         #TODO: What constitutes an "IOError: invalid data stream" ???
                         # Couldn't find much from the docs. Needs to be investigated.
+                        
+                        # Answer:
+                        # A BZ2 file corruption is seen during file creation only.
+                        # Perhaps it has to do with the bad netowrk, loss of packets et cetera
+                        # The safest bet at the moment is to simply discard such files, which were
+                        # downloaded in damaged form.
                         return False
                 return True
         

-- 
Offline APT Package Manager



More information about the Apt-offline-devel mailing list