Use vercodes in read_metadata interface

read_metadata is only called in read_app_args with an argument. As
vercodes is already there, drop the duplicate call.
This commit is contained in:
Jochen Sprickerhof 2022-07-19 13:41:24 +02:00
parent 8ab1d53318
commit 4d0a21f336
No known key found for this signature in database
GPG key ID: 5BFFDCC258E69433
2 changed files with 5 additions and 6 deletions

View file

@ -545,7 +545,7 @@ def read_srclibs():
srclibs[metadatapath.stem] = parse_yaml_srclib(metadatapath)
def read_metadata(appids={}, sort_by_time=False):
def read_metadata(appid_to_vercode={}, sort_by_time=False):
"""Return a list of App instances sorted newest first.
This reads all of the metadata files in a 'data' repository, then
@ -553,7 +553,7 @@ def read_metadata(appids={}, sort_by_time=False):
sorted based on creation time, newest first. Most of the time,
the newer files are the most interesting.
appids is a dict with appids a keys and versionCodes as values.
appid_to_vercode is a dict with appids a keys and versionCodes as values.
"""
# Always read the srclibs before the apps, since they can use a srlib as
@ -565,9 +565,8 @@ def read_metadata(appids={}, sort_by_time=False):
for basedir in ('metadata', 'tmp'):
Path(basedir).mkdir(exist_ok=True)
if appids:
vercodes = common.read_pkg_args(appids)
metadatafiles = common.get_metadata_files(vercodes)
if appid_to_vercode:
metadatafiles = common.get_metadata_files(appid_to_vercode)
else:
metadatafiles = list(Path('metadata').glob('*.yml')) + list(
Path('.').glob('.fdroid.yml')