build: do not crash if SVN URL pre-validation fails; log error

This is the problem:
https://jenkins.debian.net/job/reproducible_fdroid_build_apps/704/console
This commit is contained in:
Hans-Christoph Steiner 2019-11-13 11:58:55 +01:00
parent c74dc730dd
commit 2cbde77798
No known key found for this signature in database
GPG key ID: 3E177817BA1B9BFA

View file

@ -1034,9 +1034,12 @@ class vcs_gitsvn(vcs):
raise VCSException(_('HTTPS must be used with Subversion URLs!')) raise VCSException(_('HTTPS must be used with Subversion URLs!'))
# git-svn sucks at certificate validation, this throws useful errors: # git-svn sucks at certificate validation, this throws useful errors:
import requests try:
r = requests.head(remote) import requests
r.raise_for_status() r = requests.head(remote)
r.raise_for_status()
except Exception as e:
raise VCSException('SVN certificate pre-validation failed: ' + str(e))
location = r.headers.get('location') location = r.headers.get('location')
if location and not location.startswith('https://'): if location and not location.startswith('https://'):
raise VCSException(_('Invalid redirect to non-HTTPS: {before} -> {after} ') raise VCSException(_('Invalid redirect to non-HTTPS: {before} -> {after} ')