[Apt-offline-devel] [SCM] Offline APT Package Manager branch, master, updated. 0.9.7-5-g2e09e3b

Ritesh Raj Sarraf rrs at researchut.com
Mon Apr 19 05:44:10 UTC 2010


The following commit has been merged in the master branch:
commit 2e09e3b95df2d1533081743b5f6f0fd55d1cede6
Author: Ritesh Raj Sarraf <rrs at researchut.com>
Date:   Fri Apr 16 20:03:17 2010 +0530

    Handle Checksum for IndexError
    
    The 4th item, i.e. Checksum is not applicable for Release and
    Release.gpg uris. For these items, there is an IndexError raised for
    some reason on some user reports. Don't know why.
    But anyway, we can handle this when getting IndexErrr by checking if the
    item uri is Release and if so we set checksum to None
    
    19:50:55 rrs at champaran:~/devel/apt-offline/apt-offline  (george-bug)$
    ./apt-offline get /tmp/george.list  --verbose
    VERBOSE: Namespace(bundle_file=None, cache_dir=None, deb_bugs=False,
    disable_md5check=False, download_dir=None, func=<function fetcher at
    0x7fbe51afa230>, get='/tmp/george.list', num_of_threads=1,
    simulate=False, socket_timeout=30, verbose=True)
    VERBOSE: Default timeout now is: 30.
    
    Fetching APT Data
    
    VERBOSE: Item is
    ["'http://ftp.tw.debian.org/debian/dists/testing/Release'",
    'ftp.tw.debian.org_debian_dists_testing_Release', '0\n']
    Exception in thread Thread-1:
    Traceback (most recent call last):
      File "/usr/lib/python2.5/threading.py", line 486, in __bootstrap_inner
        self.run()
      File "/usr/lib/python2.5/threading.py", line 446, in run
        self.__target(*self.__args, **self.__kwargs)
      File
    "/home/rrs/devel/apt-offline/apt-offline/apt_offline_core/AptOfflineLib.py",
    line 578, in run
        self.responseQueue.put( self.WorkerFunction( item, thread_name ) )
      File
    "/home/rrs/devel/apt-offline/apt-offline/apt_offline_core/AptOfflineCoreLib.py",
    line 548, in DataFetcher
        (url, file, download_size, checksum) = stripper(item)
      File
    "/home/rrs/devel/apt-offline/apt-offline/apt_offline_core/AptOfflineCoreLib.py",
    line 308, in stripper
        checksum = string.rstrip(string.lstrip(''.join(item[3]), chars =
    "'"), chars = "'")
    IndexError: list index out of range

diff --git a/apt_offline_core/AptOfflineCoreLib.py b/apt_offline_core/AptOfflineCoreLib.py
index 4d143a8..b606d64 100644
--- a/apt_offline_core/AptOfflineCoreLib.py
+++ b/apt_offline_core/AptOfflineCoreLib.py
@@ -306,9 +306,12 @@ def stripper(item):
         size = int(string.rstrip(string.lstrip(''.join(item[2]), chars = "'"), chars="'"))
         #INFO: md5 ends up having '\n' with it.
         # That needs to be stripped too.
-        checksum = string.rstrip(string.lstrip(''.join(item[3]), chars = "'"), chars = "'")
-        checksum = string.rstrip(checksum, chars = "\n")
-    
+	try:
+		checksum = string.rstrip(string.lstrip(''.join(item[3]), chars = "'"), chars = "'")
+        	checksum = string.rstrip(checksum, chars = "\n")
+	except IndexError:
+		if item[1].endswith("_Release") or item[1].endswith("_Release.gpg"):
+			checksum = None
         return url, file, size, checksum
 
 

-- 
Offline APT Package Manager



More information about the Apt-offline-devel mailing list