|
|
@@ -1146,12 +1146,15 @@ def do_custom_build(self): |
|
|
os.path.isfile(tarball_cache_path)):
|
|
|
if get_file_hash(tarball_cache_path) == LOCAL_FREETYPE_HASH:
|
|
|
try:
|
|
|
- # fail on Lpy, oh well
|
|
|
- os.makedirs('build', exist_ok=True)
|
|
|
+ os.makedirs('build')
|
|
|
+ except OSError:
|
|
|
+ # Don't care if it exists.
|
|
|
+ pass
|
|
|
+ try:
|
|
|
shutil.copy(tarball_cache_path, tarball_path)
|
|
|
print('Using cached tarball: {}'
|
|
|
.format(tarball_cache_path))
|
|
|
- except:
|
|
|
+ except OSError:
|
|
|
# If this fails, oh well just re-download
|
|
|
pass
|
|
|
|
|
|
@@ -1165,12 +1168,12 @@ def do_custom_build(self): |
|
|
os.makedirs('build')
|
|
|
|
|
|
sourceforge_url = (
|
|
|
- 'http://downloads.sourceforge.net/project/freetype'
|
|
|
+ 'https://downloads.sourceforge.net/project/freetype'
|
|
|
'/freetype2/{0}/'.format(LOCAL_FREETYPE_VERSION)
|
|
|
)
|
|
|
url_fmts = (
|
|
|
sourceforge_url + '{0}',
|
|
|
- 'http://download.savannah.gnu.org/releases/freetype/{0}'
|
|
|
+ 'https://download.savannah.gnu.org/releases/freetype/{0}'
|
|
|
)
|
|
|
for url_fmt in url_fmts:
|
|
|
tarball_url = url_fmt.format(tarball)
|
|
|
@@ -1186,12 +1189,15 @@ def do_custom_build(self): |
|
|
raise IOError("Failed to download freetype")
|
|
|
if get_file_hash(tarball_path) == LOCAL_FREETYPE_HASH:
|
|
|
try:
|
|
|
- # this will fail on LPy, oh well
|
|
|
- os.makedirs(tarball_cache_dir, exist_ok=True)
|
|
|
+ os.makedirs(tarball_cache_dir)
|
|
|
+ except OSError:
|
|
|
+ # Don't care if it exists.
|
|
|
+ pass
|
|
|
+ try:
|
|
|
shutil.copy(tarball_path, tarball_cache_path)
|
|
|
print('Cached tarball at: {}'
|
|
|
.format(tarball_cache_path))
|
|
|
- except:
|
|
|
+ except OSError:
|
|
|
# again, we do not care if this fails, can
|
|
|
# always re download
|
|
|
pass
|
|
|
|
The except just below could probably be just for OSError?