[Python-checkins] r88793 - in sandbox/branches/setuptools-0.6: EasyInstall.txt setuptools/package_index.py

phillip.eby python-checkins at python.org
Wed Mar 23 21:38:13 CET 2011


Author: phillip.eby
Date: Wed Mar 23 21:38:12 2011
New Revision: 88793
Log:
Backport.
Modified:
 sandbox/branches/setuptools-0.6/EasyInstall.txt
 sandbox/branches/setuptools-0.6/setuptools/package_index.py
Modified: sandbox/branches/setuptools-0.6/EasyInstall.txt
==============================================================================
--- sandbox/branches/setuptools-0.6/EasyInstall.txt	(original)
+++ sandbox/branches/setuptools-0.6/EasyInstall.txt	Wed Mar 23 21:38:12 2011
@@ -1231,6 +1231,10 @@
 * Extract copies of hardlinked and symlinked files in tarballs when extracting
 source
 
+ * Support HTTP servers that return multiple 'Content-Length' headers
+
+ * Support user/password credentials in Subversion (svnserve) URLs
+
 0.6c11
 * Fix installed script .exe files not working with 64-bit Python on Windows
 (wasn't actually released in 0.6c10 due to a lost checkin)
Modified: sandbox/branches/setuptools-0.6/setuptools/package_index.py
==============================================================================
--- sandbox/branches/setuptools-0.6/setuptools/package_index.py	(original)
+++ sandbox/branches/setuptools-0.6/setuptools/package_index.py	Wed Mar 23 21:38:12 2011
@@ -550,7 +550,7 @@
 bs = self.dl_blocksize
 size = -1
 if "content-length" in headers:
- size = int(headers["Content-Length"])
+ size = max(map(int,headers.getheaders("Content-Length")))
 self.reporthook(url, filename, blocknum, bs, size)
 tfp = open(filename,'wb')
 while True:
@@ -639,10 +639,39 @@
 os.unlink(filename)
 raise DistutilsError("Unexpected HTML page found at "+url)
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 def _download_svn(self, url, filename):
 url = url.split('#',1)[0] # remove any fragment for svn's sake
+ creds = ''
+ if url.lower().startswith('svn:') and '@' in url:
+ scheme, netloc, path, p, q, f = urlparse.urlparse(url)
+ if not netloc and path.startswith('//') and '/' in path[2:]:
+ netloc, path = path[2:].split('/',1)
+ auth, host = urllib.splituser(netloc)
+ if auth:
+ if ':' in auth:
+ user, pw = auth.split(':',1)
+ creds = " --username=%s --password=%s" % (user, pw)
+ else:
+ creds = " --username="+auth
+ netloc = host
+ url = urlparse.urlunparse((scheme, netloc, url, p, q, f))
 self.info("Doing subversion checkout from %s to %s", url, filename)
- os.system("svn checkout -q %s %s" % (url, filename))
+ os.system("svn checkout%s -q %s %s" % (creds, url, filename))
 return filename
 
 def debug(self, msg, *args):
@@ -654,6 +683,18 @@
 def warn(self, msg, *args):
 log.warn(msg, *args)
 
+
+
+
+
+
+
+
+
+
+
+
+
 # This pattern matches a character entity reference (a decimal numeric
 # references, a hexadecimal numeric reference, or a named reference).
 entity_sub = re.compile(r'&(#(\d+|x[\da-fA-F]+)|[\w.:-]+);?').sub


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /