index: keep mirrors in the order specified in config.py

The mirrors are displayed in fdroidclient in the order they are received,
and there might be some reason why a repo maintainer wants them in a
specific order.  The danger is that if the mirrors are set in config.py
using "mirrors = {'foo', bar'}" they will have a randomized order since it
will be in a set.  They should be set using [] or () to have a fixed order.
This commit is contained in:
Hans-Christoph Steiner 2019-02-22 21:38:20 +01:00
parent 548f73d988
commit 7798dcf9dd

View file

@ -88,7 +88,7 @@ def make(apps, sortedids, apks, repodir, archive):
mirrorcheckfailed = False
mirrors = []
for mirror in sorted(common.config.get('mirrors', [])):
for mirror in common.config.get('mirrors', []):
base = os.path.basename(urllib.parse.urlparse(mirror).path.rstrip('/'))
if common.config.get('nonstandardwebroot') is not True and base != 'fdroid':
logging.error(_("mirror '%s' does not end with 'fdroid'!") % mirror)