download: clean-up, fix, optimization
An optimization is to avoid temporary file when possible: a rename (or hard link) is not always possible (different mount points). Another one is to not check md5sum twice when using cache file. Fall-back mode is ignored if an MD5 checksum is given. In case of checksum mismatch for a cached path, remove it and download again, mainly to cover the following cases: - the url content changes and the user updates the checksum - buildout killed while downloading directly to cache (see above optimization) - shutil.copyfile is interrupted
Showing
-
Owner
We have a regression in buildout and I think it's caused by this commit. While trying to build re6st source packages for OBS:
Generated script '.../project/slapos.package/obs/re6st/build/opt/re6st/bin/buildout'. While: Initializing. An internal error occurred due to a bug in either zc.buildout or in a recipe being used: Traceback (most recent call last): File ".../project/slapos.package/obs/re6st/build/opt/re6st/eggs/zc.buildout-2.7.1+slapos015-py2.7.egg/zc/buildout/buildout.py", line 2370, in main user_defaults, command, args) File ".../project/slapos.package/obs/re6st/build/opt/re6st/eggs/zc.buildout-2.7.1+slapos015-py2.7.egg/zc/buildout/buildout.py", line 312, in __init__ data['buildout'], override)) File ".../project/slapos.package/obs/re6st/build/opt/re6st/eggs/zc.buildout-2.7.1+slapos015-py2.7.egg/zc/buildout/buildout.py", line 1985, in _open seen, processing)) File ".../project/slapos.package/obs/re6st/build/opt/re6st/eggs/zc.buildout-2.7.1+slapos015-py2.7.egg/zc/buildout/buildout.py", line 1943, in _open hash_name=True)(filename) File ".../project/slapos.package/obs/re6st/build/opt/re6st/eggs/zc.buildout-2.7.1+slapos015-py2.7.egg/zc/buildout/download.py", line 164, in download_cached locate_at(path, cached_path) # update cache File ".../project/slapos.package/obs/re6st/build/opt/re6st/eggs/zc.buildout-2.7.1+slapos015-py2.7.egg/zc/buildout/download.py", line 337, in locate_at shutil.copyfile(source, dest) File ".../shared/python2.7/085031a6ed6b9ec4e4e93137a072f449/lib/python2.7/shutil.py", line 83, in copyfile raise Error("`%s` and `%s` are the same file" % (src, dst)) Error: `.../project/slapos.package/obs/re6st/slapos/stack/slapos.cfg` and `.../project/slapos.package/obs/re6st/build/opt/re6st/extends-cache/281f101d4ebf051a86c8e5e0469bac35` are the same file
/cc @Francois
Please register or sign in to comment