mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-14 23:12:46 +03:00
Always run read_srclibs as part of read_metadata
This commit is contained in:
parent
dc8eb49b31
commit
49208b257d
6 changed files with 11 additions and 6 deletions
|
@ -999,7 +999,6 @@ def main():
|
|||
|
||||
# Read all app and srclib metadata
|
||||
allapps = metadata.read_metadata(xref=not options.onserver)
|
||||
metadata.read_srclibs()
|
||||
|
||||
apps = common.read_app_args(args, allapps, True)
|
||||
apps = [app for app in apps if (options.force or not app['Disabled']) and
|
||||
|
|
|
@ -333,7 +333,6 @@ def main():
|
|||
|
||||
# Get all apps...
|
||||
allapps = metadata.read_metadata()
|
||||
metadata.read_srclibs()
|
||||
|
||||
apps = common.read_app_args(args, allapps, False)
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import logging
|
|||
|
||||
from collections import OrderedDict
|
||||
|
||||
srclibs = {}
|
||||
srclibs = None
|
||||
|
||||
|
||||
class MetaDataException(Exception):
|
||||
|
@ -451,6 +451,11 @@ def read_srclibs():
|
|||
metadata.
|
||||
"""
|
||||
global srclibs
|
||||
|
||||
# They were already loaded
|
||||
if srclibs is not None:
|
||||
return
|
||||
|
||||
srclibs = {}
|
||||
|
||||
srcdir = 'srclibs'
|
||||
|
@ -465,6 +470,11 @@ def read_srclibs():
|
|||
# Read all metadata. Returns a list of 'app' objects (which are dictionaries as
|
||||
# returned by the parse_metadata function.
|
||||
def read_metadata(xref=True):
|
||||
|
||||
# Always read the srclibs before the apps, since they can use a srlib as
|
||||
# their source repository.
|
||||
read_srclibs()
|
||||
|
||||
apps = []
|
||||
|
||||
for basedir in ('metadata', 'tmp'):
|
||||
|
|
|
@ -26,7 +26,6 @@ def main():
|
|||
common.read_config(None)
|
||||
|
||||
metadata.read_metadata(xref=True)
|
||||
metadata.read_srclibs()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
|
@ -50,7 +50,6 @@ def main():
|
|||
# Read all app and srclib metadata
|
||||
allapps = metadata.read_metadata()
|
||||
apps = common.read_app_args(args, allapps, True)
|
||||
metadata.read_srclibs()
|
||||
|
||||
problems = []
|
||||
|
||||
|
|
|
@ -71,7 +71,6 @@ def main():
|
|||
sys.exit(1)
|
||||
|
||||
# Get all metadata-defined apps...
|
||||
metadata.read_srclibs()
|
||||
metaapps = metadata.read_metadata()
|
||||
|
||||
statsdir = 'stats'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue