summaryrefslogtreecommitdiff
path: root/buildlibxml.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2017-02-12 16:17:45 +0100
committerMaximilian Hils <git@maximilianhils.com>2017-02-12 16:17:45 +0100
commit547e0564bc61d0e5055247bbc85abb1b42b92f1f (patch)
tree73c4ffdecf54edebd4f12285a62f7c7b7a478806 /buildlibxml.py
parent2b7411290c2ab4334219547d42376e915c777051 (diff)
downloadpython-lxml-547e0564bc61d0e5055247bbc85abb1b42b92f1f.tar.gz
enable caching of libraries in build step
Diffstat (limited to 'buildlibxml.py')
-rw-r--r--buildlibxml.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/buildlibxml.py b/buildlibxml.py
index 5b32034c..f55f03cc 100644
--- a/buildlibxml.py
+++ b/buildlibxml.py
@@ -56,9 +56,12 @@ def download_and_extract_zlatkovic_binaries(destdir):
for libname, libfn in libs.items():
srcfile = urljoin(url, libfn)
destfile = os.path.join(destdir, libfn)
- print('Retrieving "%s" to "%s"' % (srcfile, destfile))
- urlcleanup() # work around FTP bug 27973 in Py2.7.12+
- urlretrieve(srcfile, destfile)
+ if os.path.exists(destfile + ".keep"):
+ print('Using local copy of "{}"'.format(srcfile))
+ else:
+ print('Retrieving "%s" to "%s"' % (srcfile, destfile))
+ urlcleanup() # work around FTP bug 27973 in Py2.7.12+
+ urlretrieve(srcfile, destfile)
d = unpack_zipfile(destfile, destdir)
libs[libname] = d