From 22b30c79c05f7b810a27b7df68750b72f7e436de Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 11 Apr 2024 16:03:10 +0200 Subject: [PATCH 1/6] Zgrompf --- src/utils/resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/resources.py b/src/utils/resources.py index b433dd596..dfb6d48ed 100644 --- a/src/utils/resources.py +++ b/src/utils/resources.py @@ -155,7 +155,7 @@ class AppResource: "__YNH_DEBIAN_VERSION_ID__": debian_version_id(), "__YNH_APP_UPSTREAM_VERSION__": ( manager.wanted["version"].split("~")[0] - if manager.wanted + if "version" in manager.wanted else manager.current["version"].split("~")[0] ), } From 7d0d82ae016ae3e7cdb06423b67678d7f7a5d9ca Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 11 Apr 2024 16:04:17 +0200 Subject: [PATCH 2/6] Update changelog for 11.2.11.2 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index b596f71d9..039d0e55b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +yunohost (11.2.11.2) stable; urgency=low + + - More oopsies (22b30c79) + + -- Alexandre Aubin Thu, 11 Apr 2024 16:03:20 +0200 + yunohost (11.2.11.1) stable; urgency=low - Missing import oopsi (29c597ed) From a5560c30359a46a71445108b9cc6d9f70fb14f75 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Thu, 11 Apr 2024 21:19:14 +0200 Subject: [PATCH 3/6] Update resources.py: fix edge case when parsing app ustream version from resource manager --- src/utils/resources.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/utils/resources.py b/src/utils/resources.py index dfb6d48ed..ce2454efe 100644 --- a/src/utils/resources.py +++ b/src/utils/resources.py @@ -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: From a665f2550c087da10da1db936e566f4d041e8360 Mon Sep 17 00:00:00 2001 From: alexAubin <4533074+alexAubin@users.noreply.github.com> Date: Thu, 11 Apr 2024 19:19:35 +0000 Subject: [PATCH 4/6] :art: Format Python code with Black --- src/utils/resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/resources.py b/src/utils/resources.py index ce2454efe..ea6d6bb40 100644 --- a/src/utils/resources.py +++ b/src/utils/resources.py @@ -154,7 +154,7 @@ class AppResource: 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(), From 5e4e59a1337deb9813df90189c586de09753335a Mon Sep 17 00:00:00 2001 From: Alexandre Aubin <4533074+alexAubin@users.noreply.github.com> Date: Thu, 11 Apr 2024 23:30:18 +0200 Subject: [PATCH 5/6] Update resources.py --- src/utils/resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/resources.py b/src/utils/resources.py index ea6d6bb40..e2400e91d 100644 --- a/src/utils/resources.py +++ b/src/utils/resources.py @@ -152,7 +152,7 @@ class AppResource: 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: + elif manager and manager.current and "version" in manager.current: app_upstream_version = manager.current["version"].split("~")[0] replacements: dict[str, str] = { From 537699ca900863c522244304e832ebbcc4287603 Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Sun, 14 Apr 2024 20:02:16 +0200 Subject: [PATCH 6/6] helpers: fix 'ls: cannot access No such file or directory' errors on CI --- helpers/utils | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/utils b/helpers/utils index 5b286e355..34de8f0bc 100644 --- a/helpers/utils +++ b/helpers/utils @@ -843,7 +843,7 @@ ynh_get_debian_release() { _acceptable_path_to_delete() { local file=$1 - local forbidden_paths=$(ls -d / /* /{var,home,usr}/* /etc/{default,sudoers.d,yunohost,cron*} /etc/yunohost/{apps,domains,hooks.d} /opt/yunohost) + local forbidden_paths=$(ls -d / /* /{var,home,usr}/* /etc/{default,sudoers.d,yunohost,cron*} /etc/yunohost/{apps,domains,hooks.d} /opt/yunohost 2> /dev/null) # Legacy : A couple apps still have data in /home/$app ... if [[ -n "${app:-}" ]]