Hi,

with apt-0.6 and it's Release.gpg/Release file checking code I'm hit
by this problem fairly regularly. Attached is a patch that adds a
special case for Release.gpg index files. 

The idea is that if the Release.gpg file is too old and will be
rechecked, all other files under that prefix must be rechecked as
well (and their update_time is set to 0).

I hope this is not too hackish and it will be considered (I'm happy to
talk about better ways to implement it of course).

Thanks,
 Michael

-- 
Linux is not The Answer. Yes is the answer. Linux is The Question. - Neo
Index: apt_proxy/apt_proxy.py
===================================================================
--- apt_proxy/apt_proxy.py      (revision 525)
+++ apt_proxy/apt_proxy.py      (working copy)
@@ -1527,6 +1586,17 @@
                 deferred.callback(None)
             elif last_access < min_time:
                 log.debug("file is too old: "+self.local_file, 'file_ok')
+
+                # special case for Release file (make sure all files under
+                # a release file are set to the same time)
+                if self.uri.endswith("Release.gpg"):
+                    prefix=self.uri[:-len("Release.gpg")]
+                    log.debug("getting release file, applying hack for prefix: 
%s" % prefix,"file_ok")
+                    for elm in update_times.keys():
+                        if elm.startswith(prefix):
+                            log.debug("setting access to,e %s to 0" % 
elm,"file_ok")
+                            update_times[elm] = 0
+
                 update_times[self.uri] = cur_time
                 deferred.errback()
             else:

Reply via email to