mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Update resources.py: fix edge case when parsing app ustream version from resource manager
This commit is contained in:
parent
7d0d82ae01
commit
a5560c3035
1 changed files with 8 additions and 5 deletions
|
@ -148,16 +148,19 @@ class AppResource:
|
|||
self.manager = manager
|
||||
properties = self.default_properties | properties
|
||||
|
||||
# It's not guaranteed that this info will be defined, e.g. during unit tests, only small resource snippets are used, not proper manifests
|
||||
app_upstream_version = ""
|
||||
if manager and manager.wanted and "version" in manager.wanted:
|
||||
app_upstream_version = manager.wanted["version"].split("~")[0]
|
||||
elif maanger and manager.current and "version" in manager.current:
|
||||
app_upstream_version = manager.current["version"].split("~")[0]
|
||||
|
||||
replacements: dict[str, str] = {
|
||||
"__APP__": self.app,
|
||||
"__YNH_ARCH__": system_arch(),
|
||||
"__YNH_DEBIAN_VERSION__": debian_version(),
|
||||
"__YNH_DEBIAN_VERSION_ID__": debian_version_id(),
|
||||
"__YNH_APP_UPSTREAM_VERSION__": (
|
||||
manager.wanted["version"].split("~")[0]
|
||||
if "version" in manager.wanted
|
||||
else manager.current["version"].split("~")[0]
|
||||
),
|
||||
"__YNH_APP_UPSTREAM_VERSION__": app_upstream_version,
|
||||
}
|
||||
|
||||
def recursive_apply(function: Callable, data: Any) -> Any:
|
||||
|
|
Loading…
Add table
Reference in a new issue