mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
Fix check_id_unicity, uniformize URL syntax (lowercase) so that app id are consistent with the URL
This commit is contained in:
parent
6e0a5a9bb6
commit
8e8b9a1594
2 changed files with 15 additions and 17 deletions
16
apps.json
16
apps.json
|
@ -23,7 +23,7 @@
|
|||
"category": "system_tools",
|
||||
"level": 7,
|
||||
"state": "working",
|
||||
"url": "https://github.com/YunoHost-Apps/2FAuth_ynh"
|
||||
"url": "https://github.com/YunoHost-Apps/2fauth_ynh"
|
||||
},
|
||||
"abantecart": {
|
||||
"category": "publishing",
|
||||
|
@ -662,7 +662,7 @@
|
|||
"category": "games",
|
||||
"level": 8,
|
||||
"state": "working",
|
||||
"url": "https://github.com/YunoHost-Apps/Cubiks-2048_ynh"
|
||||
"url": "https://github.com/YunoHost-Apps/cubiks-2048_ynh"
|
||||
},
|
||||
"cypht": {
|
||||
"category": "communication",
|
||||
|
@ -2134,7 +2134,7 @@
|
|||
"level": 0,
|
||||
"revision": "a38a83fea289f77910fd98b34ea58eea5f5909db",
|
||||
"state": "notworking",
|
||||
"url": "https://github.com/YunoHost-Apps/LBCAlerte_ynh"
|
||||
"url": "https://github.com/YunoHost-Apps/lbcalerte_ynh"
|
||||
},
|
||||
"leed": {
|
||||
"category": "reading",
|
||||
|
@ -3723,7 +3723,7 @@
|
|||
"remotestorage": {
|
||||
"category": "small_utilities",
|
||||
"state": "notworking",
|
||||
"url": "https://github.com/YunoHost-Apps/RemoteStorage_ynh"
|
||||
"url": "https://github.com/YunoHost-Apps/remotestorage_ynh"
|
||||
},
|
||||
"restic": {
|
||||
"category": "system_tools",
|
||||
|
@ -3990,7 +3990,7 @@
|
|||
"category": "small_utilities",
|
||||
"level": 7,
|
||||
"state": "working",
|
||||
"url": "https://github.com/YunoHost-Apps/Signaturepdf_ynh"
|
||||
"url": "https://github.com/YunoHost-Apps/signaturepdf_ynh"
|
||||
},
|
||||
"simple-hash-generator": {
|
||||
"category": "small_utilities",
|
||||
|
@ -4014,7 +4014,7 @@
|
|||
"subtags": [
|
||||
"websites"
|
||||
],
|
||||
"url": "https://github.com/YunoHost-Apps/SitemagicCMS_ynh"
|
||||
"url": "https://github.com/YunoHost-Apps/sitemagiccms_ynh"
|
||||
},
|
||||
"slingcode": {
|
||||
"category": "dev",
|
||||
|
@ -4583,7 +4583,7 @@
|
|||
"category": "multimedia",
|
||||
"level": 6,
|
||||
"state": "working",
|
||||
"url": "https://github.com/YunoHost-Apps/UMS_ynh"
|
||||
"url": "https://github.com/YunoHost-Apps/ums_ynh"
|
||||
},
|
||||
"unattended_upgrades": {
|
||||
"category": "system_tools",
|
||||
|
@ -4999,4 +4999,4 @@
|
|||
"state": "working",
|
||||
"url": "https://github.com/YunoHost-Apps/zwave-js-ui_ynh"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -24,15 +24,17 @@ def get_json(url, verify=True, token=None):
|
|||
def main(apps):
|
||||
for app_id, app_data in apps.items():
|
||||
url = app_data["url"]
|
||||
if app_data.get("state") != "working":
|
||||
continue
|
||||
github_repo_name = url.split("/")[-1].replace("_ynh", "")
|
||||
|
||||
if app_id != github_repo_name:
|
||||
print "[%s] GitHub repo name is not coherent with app id: '%s' vs '%s' (%s)" % (app_id, app_id, url.split("/")[-1], url)
|
||||
print("[%s] GitHub repo name is not coherent with app id: '%s' vs '%s' (%s)" % (app_id, app_id, url.split("/")[-1], url))
|
||||
|
||||
owner, repo_name = url.split("/")[-2:]
|
||||
|
||||
raw_url = "https://raw.githubusercontent.com/%s/%s/%s/manifest.json" % (
|
||||
owner, repo_name, app_data["revision"]
|
||||
owner, repo_name, app_data.get("branch", "master")
|
||||
)
|
||||
|
||||
manifest = get_json(raw_url)
|
||||
|
@ -42,15 +44,11 @@ def main(apps):
|
|||
|
||||
manifest_id = manifest["id"]
|
||||
if app_id != manifest_id:
|
||||
print "[%s] manifest id is different from app id: '%s' vs '%s' (manifest_id" % (app_id, app_id, manifest_id)
|
||||
print("[%s] manifest id is different from app id: '%s' vs '%s' (manifest_id" % (app_id, app_id, manifest_id))
|
||||
|
||||
if manifest_id != github_repo_name:
|
||||
print "[%s] manifest id is different from GitHub repo name: '%s' vs '%s' (%s)" % (app_id, manifest_id, url.split("/")[-1], url)
|
||||
print("[%s] manifest id is different from GitHub repo name: '%s' vs '%s' (%s)" % (app_id, manifest_id, url.split("/")[-1], url))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if not sys.argv[1:]:
|
||||
print "Usage: python check_id_unicity.py list.json"
|
||||
sys.exit(1)
|
||||
|
||||
main(json.load(open(sys.argv[1])))
|
||||
main(json.load(open("apps.json")))
|
||||
|
|
Loading…
Add table
Reference in a new issue