mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-17 18:50:11 +02:00
Also skip unmodified fields in the regex checks
Now it's close to 1s.
This commit is contained in:
parent
ea99add3da
commit
2711f1c868
@ -437,7 +437,7 @@ valuetypes = {
|
|||||||
|
|
||||||
FieldValidator("HTTP link",
|
FieldValidator("HTTP link",
|
||||||
r'^http[s]?://', None,
|
r'^http[s]?://', None,
|
||||||
["Web Site", "Source Code", "Issue Tracker", "Changelog", "Donate"], []),
|
["WebSite", "SourceCode", "IssueTracker", "Changelog", "Donate"], []),
|
||||||
|
|
||||||
FieldValidator("Bitcoin address",
|
FieldValidator("Bitcoin address",
|
||||||
r'^[a-zA-Z0-9]{27,34}$', None,
|
r'^[a-zA-Z0-9]{27,34}$', None,
|
||||||
@ -451,7 +451,7 @@ valuetypes = {
|
|||||||
|
|
||||||
FieldValidator("Repo Type",
|
FieldValidator("Repo Type",
|
||||||
['git', 'git-svn', 'svn', 'hg', 'bzr', 'srclib'], None,
|
['git', 'git-svn', 'svn', 'hg', 'bzr', 'srclib'], None,
|
||||||
["Repo Type"],
|
["RepoType"],
|
||||||
[]),
|
[]),
|
||||||
|
|
||||||
FieldValidator("Binaries",
|
FieldValidator("Binaries",
|
||||||
@ -461,7 +461,7 @@ valuetypes = {
|
|||||||
|
|
||||||
FieldValidator("Archive Policy",
|
FieldValidator("Archive Policy",
|
||||||
r'^[0-9]+ versions$', None,
|
r'^[0-9]+ versions$', None,
|
||||||
["Archive Policy"],
|
["ArchivePolicy"],
|
||||||
[]),
|
[]),
|
||||||
|
|
||||||
FieldValidator("Anti-Feature",
|
FieldValidator("Anti-Feature",
|
||||||
@ -471,12 +471,12 @@ valuetypes = {
|
|||||||
|
|
||||||
FieldValidator("Auto Update Mode",
|
FieldValidator("Auto Update Mode",
|
||||||
r"^(Version .+|None)$", None,
|
r"^(Version .+|None)$", None,
|
||||||
["Auto Update Mode"],
|
["AutoUpdateMode"],
|
||||||
[]),
|
[]),
|
||||||
|
|
||||||
FieldValidator("Update Check Mode",
|
FieldValidator("Update Check Mode",
|
||||||
r"^(Tags|Tags .+|RepoManifest|RepoManifest/.+|RepoTrunk|HTTP|Static|None)$", None,
|
r"^(Tags|Tags .+|RepoManifest|RepoManifest/.+|RepoTrunk|HTTP|Static|None)$", None,
|
||||||
["Update Check Mode"],
|
["UpdateCheckMode"],
|
||||||
[])
|
[])
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -484,11 +484,15 @@ valuetypes = {
|
|||||||
# Check an app's metadata information for integrity errors
|
# Check an app's metadata information for integrity errors
|
||||||
def check_metadata(app):
|
def check_metadata(app):
|
||||||
for v in valuetypes:
|
for v in valuetypes:
|
||||||
for f in v.fields:
|
for k in v.fields:
|
||||||
v.check(app.get_field(f), app.id)
|
if k not in app._modified:
|
||||||
|
continue
|
||||||
|
v.check(app.__dict__[k], app.id)
|
||||||
for build in app.builds:
|
for build in app.builds:
|
||||||
for f in v.flags:
|
for k in v.flags:
|
||||||
v.check(build.get_flag(f), app.id)
|
if k not in build._modified:
|
||||||
|
continue
|
||||||
|
v.check(build.__dict__[k], app.id)
|
||||||
|
|
||||||
|
|
||||||
# Formatter for descriptions. Create an instance, and call parseline() with
|
# Formatter for descriptions. Create an instance, and call parseline() with
|
||||||
|
Loading…
Reference in New Issue
Block a user