mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-18 20:50:10 +01:00
Merge branch 'random-fixes' into 'master'
random fixes See merge request fdroid/fdroidserver!605
This commit is contained in:
commit
357dea762d
6
buildserver/Vagrantfile
vendored
6
buildserver/Vagrantfile
vendored
@ -43,8 +43,12 @@ Vagrant.configure("2") do |config|
|
|||||||
libvirt.nic_model_type = configfile["libvirt_nic_model_type"]
|
libvirt.nic_model_type = configfile["libvirt_nic_model_type"]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
config.vm.synced_folder './', '/vagrant', type: '9p'
|
if configfile.has_key? "synced_folder_type"
|
||||||
|
synced_folder_type = configfile["synced_folder_type"]
|
||||||
|
else
|
||||||
synced_folder_type = '9p'
|
synced_folder_type = '9p'
|
||||||
|
end
|
||||||
|
config.vm.synced_folder './', '/vagrant', type: synced_folder_type
|
||||||
else
|
else
|
||||||
abort("No supported VM Provider found, set vm_provider in Vagrantfile.yaml!")
|
abort("No supported VM Provider found, set vm_provider in Vagrantfile.yaml!")
|
||||||
end
|
end
|
||||||
|
@ -85,3 +85,10 @@
|
|||||||
#
|
#
|
||||||
# libvirt_disk_bus = 'sata'
|
# libvirt_disk_bus = 'sata'
|
||||||
# libvirt_nic_model_type = 'rtl8139'
|
# libvirt_nic_model_type = 'rtl8139'
|
||||||
|
|
||||||
|
# Sometimes, it is not possible to use the 9p synced folder type with
|
||||||
|
# libvirt, like if running a KVM buildserver instance inside of a
|
||||||
|
# VMware ESXi guest. In that case, using NFS or another method is
|
||||||
|
# required.
|
||||||
|
#
|
||||||
|
# synced_folder_type = 'nfs'
|
||||||
|
@ -686,7 +686,7 @@ def get_mirror_service_urls(url):
|
|||||||
return urls
|
return urls
|
||||||
|
|
||||||
|
|
||||||
def download_repo_index(url_str, etag=None, verify_fingerprint=True):
|
def download_repo_index(url_str, etag=None, verify_fingerprint=True, timeout=600):
|
||||||
"""Downloads and verifies index file, then returns its data.
|
"""Downloads and verifies index file, then returns its data.
|
||||||
|
|
||||||
Downloads the repository index from the given :param url_str and
|
Downloads the repository index from the given :param url_str and
|
||||||
@ -710,7 +710,7 @@ def download_repo_index(url_str, etag=None, verify_fingerprint=True):
|
|||||||
fingerprint = query['fingerprint'][0]
|
fingerprint = query['fingerprint'][0]
|
||||||
|
|
||||||
url = urllib.parse.SplitResult(url.scheme, url.netloc, url.path + '/index-v1.jar', '', '')
|
url = urllib.parse.SplitResult(url.scheme, url.netloc, url.path + '/index-v1.jar', '', '')
|
||||||
download, new_etag = net.http_get(url.geturl(), etag)
|
download, new_etag = net.http_get(url.geturl(), etag, timeout)
|
||||||
|
|
||||||
if download is None:
|
if download is None:
|
||||||
return None, new_etag
|
return None, new_etag
|
||||||
|
@ -165,6 +165,8 @@ regex_checks = {
|
|||||||
'Description': https_enforcings + http_url_shorteners + [
|
'Description': https_enforcings + http_url_shorteners + [
|
||||||
(re.compile(r'\s*[*#][^ .]'),
|
(re.compile(r'\s*[*#][^ .]'),
|
||||||
_("Invalid bulleted list")),
|
_("Invalid bulleted list")),
|
||||||
|
(re.compile(r'https://f-droid.org/[a-z][a-z](_[A-Za-z]{2,4})?/'),
|
||||||
|
_("Locale included in f-droid.org URL")),
|
||||||
(re.compile(r'^\s'),
|
(re.compile(r'^\s'),
|
||||||
_("Unnecessary leading space")),
|
_("Unnecessary leading space")),
|
||||||
(re.compile(r'.*\s$'),
|
(re.compile(r'.*\s$'),
|
||||||
@ -525,6 +527,35 @@ def check_for_unsupported_metadata_files(basedir=""):
|
|||||||
return return_value
|
return return_value
|
||||||
|
|
||||||
|
|
||||||
|
def check_current_version_code(app):
|
||||||
|
"""Check that the CurrentVersionCode is currently available"""
|
||||||
|
|
||||||
|
archive_policy = app.get('ArchivePolicy')
|
||||||
|
if archive_policy and archive_policy.split()[0] == "0":
|
||||||
|
return
|
||||||
|
cv = app.get('CurrentVersionCode')
|
||||||
|
if cv is not None and int(cv) == 0:
|
||||||
|
return
|
||||||
|
|
||||||
|
builds = app.get('builds')
|
||||||
|
active_builds = 0
|
||||||
|
min_versionCode = None
|
||||||
|
if builds:
|
||||||
|
for build in builds:
|
||||||
|
vc = int(build['versionCode'])
|
||||||
|
if min_versionCode is None or min_versionCode > vc:
|
||||||
|
min_versionCode = vc
|
||||||
|
if not build.get('disable'):
|
||||||
|
active_builds += 1
|
||||||
|
if cv == build['versionCode']:
|
||||||
|
break
|
||||||
|
if active_builds == 0:
|
||||||
|
return # all builds are disabled
|
||||||
|
if cv is not None and int(cv) < min_versionCode:
|
||||||
|
yield(_('CurrentVersionCode {cv} is less than oldest build entry {versionCode}')
|
||||||
|
.format(cv=cv, versionCode=min_versionCode))
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
global config, options
|
global config, options
|
||||||
@ -579,6 +610,7 @@ def main():
|
|||||||
check_files_dir,
|
check_files_dir,
|
||||||
check_format,
|
check_format,
|
||||||
check_license_tag,
|
check_license_tag,
|
||||||
|
check_current_version_code,
|
||||||
]
|
]
|
||||||
|
|
||||||
for check_func in app_check_funcs:
|
for check_func in app_check_funcs:
|
||||||
|
@ -36,7 +36,7 @@ def download_file(url, local_filename=None, dldir='tmp'):
|
|||||||
return local_filename
|
return local_filename
|
||||||
|
|
||||||
|
|
||||||
def http_get(url, etag=None):
|
def http_get(url, etag=None, timeout=600):
|
||||||
"""
|
"""
|
||||||
Downloads the content from the given URL by making a GET request.
|
Downloads the content from the given URL by making a GET request.
|
||||||
|
|
||||||
@ -52,12 +52,12 @@ def http_get(url, etag=None):
|
|||||||
# TODO disable TLS Session IDs and TLS Session Tickets
|
# TODO disable TLS Session IDs and TLS Session Tickets
|
||||||
# (plain text cookie visible to anyone who can see the network traffic)
|
# (plain text cookie visible to anyone who can see the network traffic)
|
||||||
if etag:
|
if etag:
|
||||||
r = requests.head(url, headers=headers)
|
r = requests.head(url, headers=headers, timeout=timeout)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
if 'ETag' in r.headers and etag == r.headers['ETag']:
|
if 'ETag' in r.headers and etag == r.headers['ETag']:
|
||||||
return None, etag
|
return None, etag
|
||||||
|
|
||||||
r = requests.get(url, headers=headers)
|
r = requests.get(url, headers=headers, timeout=timeout)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
|
||||||
new_etag = None
|
new_etag = None
|
||||||
|
Loading…
Reference in New Issue
Block a user