Use CDN to download source release. (#529)

This commit is contained in:
Adrien Grand 2022-01-05 15:54:33 +01:00 committed by GitHub
parent 6149387f7c
commit 65296e5f84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -167,8 +167,8 @@ def check_backcompat_tests():
scriptutil.run('./gradlew -p lucene/backward-codecs test --tests TestBackwardsCompatibility')
print('ok')
def download_from_mirror(version, remotename, localname):
url = 'http://apache.cs.utah.edu/lucene/java/%s/%s' % (version, remotename)
def download_from_cdn(version, remotename, localname):
url = 'http://dlcdn.apache.org/lucene/java/%s/%s' % (version, remotename)
try:
urllib.request.urlretrieve(url, localname)
return True
@ -199,9 +199,9 @@ def download_release(version, temp_dir, force):
filename = 'lucene-%s-src.tgz' % version
source_tgz = os.path.join(temp_dir, filename)
if not download_from_mirror(version, filename, source_tgz) and \
if not download_from_cdn(version, filename, source_tgz) and \
not download_from_archives(version, filename, source_tgz):
raise Exception('Could not find version %s in apache mirror or archives' % version)
raise Exception('Could not find version %s in apache CDN or archives' % version)
olddir = os.getcwd()
os.chdir(temp_dir)