Wanna see this logo while booting your 2.6 kernel? Click here!

08.09.2006 09:44

apt-proxy: Patch for making the '~' characters in URIs work again


Today I returned from my vacation and finally got myself some time to fix the apt-proxy issue where apt-proxy can't handle the new '~' characters in Debian's package names.
To me it seems as if the problem is caused by the python urlparse module, but as I'm no real python programmer, I don't know for sure.

I filed a bugreport at the Debian BTS, but until now it is not online...

Anyway, here's a patch that solves this issue by working around this issue. The patch has to be applied to the file "/usr/share/pycentral/apt-proxy/site-packages/apt_proxy/apt_proxy.py".

--- apt_proxy.py	2006-08-15 00:00:45.000000000 +0200
+++ /root/apt_proxy.py.new	2006-09-08 09:07:49.849166662 +0200
@@ -182,6 +182,10 @@
 
         self.scheme, netloc, self.path, parameters, \
                      query, fragment = urlparse.urlparse(uri)
+
+	# ``~`` are allowed in urls!!!
+	self.path = self.path.replace("%7e", "~")
+
         if is_rsync:
             self.scheme = 'rsync'
 
@@ -284,6 +288,10 @@
     def clean_path(self, uri):
         # Clean up URL given
         scheme, netloc, path, params, query, fragment = urlparse.urlparse(uri)
+
+	# ``~`` are allowed in urls!!!
+	path = path.replace("%7e", "~")
+
         return os.path.normpath(path)
 
     def not_modified(self):

Downloads: