From: Hans-Christoph Steiner Date: Fri, 7 Jul 2017 13:50:11 +0000 (+0200) Subject: ensure that mirror URLs always include the repodir X-Git-Tag: 0.8~13 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=25f96e191138de08e6632b5bf37f2346b458ec11;p=fdroidserver.git ensure that mirror URLs always include the repodir Since the mirror URLs are per repo section (repo/archive), the mirror URLs must include the repodir at the end. This was missing for servergitmirrors found by @cde when working on fdroidclient#35 --- diff --git a/fdroidserver/index.py b/fdroidserver/index.py index 942c5861..6843f520 100644 --- a/fdroidserver/index.py +++ b/fdroidserver/index.py @@ -113,8 +113,8 @@ def make(apps, sortedids, apks, repodir, archive): mirrors.append(urllib.parse.urljoin(mirror + '/', urlbasepath)) for mirror in common.config.get('servergitmirrors', []): mirror = get_mirror_service_url(mirror) - if mirror is not None: - mirrors.append(mirror + '/') + if mirror: + mirrors.append(mirror + '/' + repodir) if mirrorcheckfailed: raise FDroidException("Malformed repository mirrors.") if mirrors: diff --git a/tests/run-tests b/tests/run-tests index 625402e8..eef54ee4 100755 --- a/tests/run-tests +++ b/tests/run-tests @@ -1038,11 +1038,16 @@ cp -a $WORKSPACE/tests/metadata $WORKSPACE/tests/repo $WORKSPACE/tests/stats $OF echo 'keystorepass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py echo 'keypass = "r9aquRHYoI8+dYz6jKrLntQ5/NJNASFBacJh7Jv2BlI="' >> config.py +echo "mirrors = ['http://foo.bar/fdroid', 'http://asdflkdsfjafdsdfhkjh.onion/fdroid']" >> config.py echo "servergitmirrors = '$SERVER_GIT_MIRROR'" >> config.py echo "local_copy_dir = '$LOCAL_COPY_DIR'" >> config.py echo "accepted_formats = ['json', 'txt', 'yml']" >> config.py -$fdroid update --verbose +$fdroid update --pretty grep -F '' repo/index.xml +grep -F '/fdroid/archive' archive/index.xml +test `grep '' repo/index.xml | wc -l` -eq 2 +test `grep '' archive/index.xml | wc -l` -eq 2 cd binary_transparency [ `git rev-list --count HEAD` == "1" ] cd ..