mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-04 22:40:29 +03:00
check whether metadata file is a duplicate before parsing it
By checking first, this prevents a stacktrace when the duplicate metadata file is not valid. For example, in the tests, the duplicate is just a zero length file, which was causing a stacktrace.
This commit is contained in:
parent
226237c5f7
commit
400acdefab
1 changed files with 3 additions and 2 deletions
|
|
@ -783,9 +783,10 @@ def read_metadata(xref=True):
|
||||||
+ glob.glob('.fdroid.json')
|
+ glob.glob('.fdroid.json')
|
||||||
+ glob.glob('.fdroid.xml')
|
+ glob.glob('.fdroid.xml')
|
||||||
+ glob.glob('.fdroid.yml')):
|
+ glob.glob('.fdroid.yml')):
|
||||||
|
packageName, _ = fdroidserver.common.get_extension(os.path.basename(metadatapath))
|
||||||
|
if packageName in apps:
|
||||||
|
raise MetaDataException("Found multiple metadata files for " + packageName)
|
||||||
app = parse_metadata(metadatapath)
|
app = parse_metadata(metadatapath)
|
||||||
if app.id in apps:
|
|
||||||
raise MetaDataException("Found multiple metadata files for " + app.id)
|
|
||||||
check_metadata(app)
|
check_metadata(app)
|
||||||
apps[app.id] = app
|
apps[app.id] = app
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue