[Checkins] SVN: zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.py fixed path and handling and default cache filename
Thomas Lotze
tl at gocept.com
Tue Jun 9 14:24:42 EDT 2009
Log message for revision 100762:
fixed path and handling and default cache filename
Changed:
U zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.py
-=-
Modified: zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.py
===================================================================
--- zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.py 2009-06-09 17:46:50 UTC (rev 100761)
+++ zc.buildout/branches/tlotze-download-api/src/zc/buildout/download.py 2009-06-09 18:24:41 UTC (rev 100762)
@@ -17,6 +17,7 @@
from hashlib import md5
except ImportError:
from md5 import new as md5
+from zc.buildout.easy_install import realpath
import atexit
import os
import os.path
@@ -69,8 +70,8 @@
self.use_cache = use_cache
self.namespace = namespace
if use_cache and self.buildout.get('download-cache'):
- self.cache = os.path.join(self.buildout['download-cache'],
- namespace or '')
+ self.cache = os.path.join(
+ realpath(self.buildout['download-cache']), namespace or '')
else:
self.cache = None
@@ -91,8 +92,7 @@
else:
local_path = self.download(url, md5sum, path)
- if (path is None
- or os.path.abspath(path) == os.path.abspath(local_path)):
+ if path is None or realpath(path) == realpath(local_path):
return local_path
try:
@@ -177,11 +177,12 @@
if self.hash_name:
return md5(url).hexdigest()
else:
- for name in reversed(urlparse.urlparse(url).path.split('/')):
+ parsed = urlparse.urlparse(url)
+ for name in reversed(parsed.path.split('/')):
if name:
return name
else:
- return 'default'
+ return '%s:%s' % (parsed.host, parsed.port)
def check_md5sum(path, md5sum):
More information about the Checkins
mailing list