From f6f2fb0b89fb47973fe6767ed8fdb153e8e4d873 Mon Sep 17 00:00:00 2001 From: Marcus Date: Thu, 10 Jan 2019 13:46:49 +0000 Subject: [PATCH] Revert "Merge branch 'random-fixes' into 'master'" This reverts merge request !605 --- buildserver/Vagrantfile | 8 ++------ examples/makebuildserver.config.py | 7 ------- fdroidserver/index.py | 4 ++-- fdroidserver/lint.py | 32 ------------------------------ fdroidserver/net.py | 6 +++--- setup.py | 2 +- 6 files changed, 8 insertions(+), 51 deletions(-) diff --git a/buildserver/Vagrantfile b/buildserver/Vagrantfile index 392d3df6..013b5382 100644 --- a/buildserver/Vagrantfile +++ b/buildserver/Vagrantfile @@ -43,12 +43,8 @@ Vagrant.configure("2") do |config| libvirt.nic_model_type = configfile["libvirt_nic_model_type"] end end - if configfile.has_key? "synced_folder_type" - synced_folder_type = configfile["synced_folder_type"] - else - synced_folder_type = '9p' - end - config.vm.synced_folder './', '/vagrant', type: synced_folder_type + config.vm.synced_folder './', '/vagrant', type: '9p' + synced_folder_type = '9p' else abort("No supported VM Provider found, set vm_provider in Vagrantfile.yaml!") end diff --git a/examples/makebuildserver.config.py b/examples/makebuildserver.config.py index cb47f95f..9d1dae31 100644 --- a/examples/makebuildserver.config.py +++ b/examples/makebuildserver.config.py @@ -85,10 +85,3 @@ # # libvirt_disk_bus = 'sata' # 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' diff --git a/fdroidserver/index.py b/fdroidserver/index.py index 7585563f..1ce940b3 100644 --- a/fdroidserver/index.py +++ b/fdroidserver/index.py @@ -686,7 +686,7 @@ def get_mirror_service_urls(url): return urls -def download_repo_index(url_str, etag=None, verify_fingerprint=True, timeout=600): +def download_repo_index(url_str, etag=None, verify_fingerprint=True): """Downloads and verifies index file, then returns its data. 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, timeout=600 fingerprint = query['fingerprint'][0] url = urllib.parse.SplitResult(url.scheme, url.netloc, url.path + '/index-v1.jar', '', '') - download, new_etag = net.http_get(url.geturl(), etag, timeout) + download, new_etag = net.http_get(url.geturl(), etag) if download is None: return None, new_etag diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index 465954cc..9eaf4b19 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -165,8 +165,6 @@ regex_checks = { 'Description': https_enforcings + http_url_shorteners + [ (re.compile(r'\s*[*#][^ .]'), _("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'), _("Unnecessary leading space")), (re.compile(r'.*\s$'), @@ -527,35 +525,6 @@ def check_for_unsupported_metadata_files(basedir=""): 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(): global config, options @@ -610,7 +579,6 @@ def main(): check_files_dir, check_format, check_license_tag, - check_current_version_code, ] for check_func in app_check_funcs: diff --git a/fdroidserver/net.py b/fdroidserver/net.py index b9ddf72b..7e8821ea 100644 --- a/fdroidserver/net.py +++ b/fdroidserver/net.py @@ -36,7 +36,7 @@ def download_file(url, local_filename=None, dldir='tmp'): return local_filename -def http_get(url, etag=None, timeout=600): +def http_get(url, etag=None): """ Downloads the content from the given URL by making a GET request. @@ -52,12 +52,12 @@ def http_get(url, etag=None, timeout=600): # TODO disable TLS Session IDs and TLS Session Tickets # (plain text cookie visible to anyone who can see the network traffic) if etag: - r = requests.head(url, headers=headers, timeout=timeout) + r = requests.head(url, headers=headers) r.raise_for_status() if 'ETag' in r.headers and etag == r.headers['ETag']: return None, etag - r = requests.get(url, headers=headers, timeout=timeout) + r = requests.get(url, headers=headers) r.raise_for_status() new_etag = None diff --git a/setup.py b/setup.py index 30f2d37b..7a40a4d9 100755 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ setup(name='fdroidserver', 'babel', ], install_requires=[ - 'androguard >= 3.1.0rc2, < 3.3.0', + 'androguard >= 3.1.0rc2', 'clint', 'defusedxml', 'GitPython',