mirror of
https://github.com/YunoHost/apps.git
synced 2024-09-03 20:06:07 +02:00
listbuilder: add trick to compute when an app was added to catalog
This commit is contained in:
parent
f4fae1a4c6
commit
476796b184
1 changed files with 5 additions and 0 deletions
|
@ -293,6 +293,10 @@ def build_app_dict(app, infos):
|
||||||
this_app_cache = app_cache_folder(app)
|
this_app_cache = app_cache_folder(app)
|
||||||
assert os.path.exists(this_app_cache), "No cache yet for %s" % app
|
assert os.path.exists(this_app_cache), "No cache yet for %s" % app
|
||||||
|
|
||||||
|
commit_timestamps_for_this_app_in_catalog = git(f'log -G "{app}"|\[{app}\] --first-parent --reverse --date=unix --format=%cd -- apps.json apps.toml')
|
||||||
|
# Assume the first entry we get (= the oldest) is the time the app was added
|
||||||
|
infos["added_in_catalog"] = int(commit_timestamps_for_this_app_in_catalog.split("\n")[0])
|
||||||
|
|
||||||
infos["branch"] = infos.get("branch", "master")
|
infos["branch"] = infos.get("branch", "master")
|
||||||
infos["revision"] = infos.get("revision", "HEAD")
|
infos["revision"] = infos.get("revision", "HEAD")
|
||||||
|
|
||||||
|
@ -342,6 +346,7 @@ def build_app_dict(app, infos):
|
||||||
"revision": infos["revision"],
|
"revision": infos["revision"],
|
||||||
"url": infos["url"],
|
"url": infos["url"],
|
||||||
},
|
},
|
||||||
|
"added_in_catalog": infos["added_in_catalog"],
|
||||||
"lastUpdate": timestamp,
|
"lastUpdate": timestamp,
|
||||||
"manifest": manifest,
|
"manifest": manifest,
|
||||||
"state": infos["state"],
|
"state": infos["state"],
|
||||||
|
|
Loading…
Add table
Reference in a new issue