From 04da7f1670c25f0d8b24b8e709fe6314e5c6637c Mon Sep 17 00:00:00 2001 From: ewilly Date: Sat, 7 Oct 2023 10:32:40 +0200 Subject: [PATCH] Remove old python directories before recreating them --- manifest.toml | 2 +- scripts/_common.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/manifest.toml b/manifest.toml index ca0b222..31dcc57 100644 --- a/manifest.toml +++ b/manifest.toml @@ -5,7 +5,7 @@ name = "Home Assistant" description.en = "Home automation platform" description.fr = "Plateforme domotique" -version = "2023.10.1~ynh1" +version = "2023.10.1~ynh2" maintainers = ["ewilly"] diff --git a/scripts/_common.sh b/scripts/_common.sh index 7d7a910..8e9e576 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -149,6 +149,10 @@ myynh_upgrade_venv_directory () { # Remove old python links before recreating them find "$install_dir/bin/" -type l -name 'python*' -exec bash -c 'rm -f "$1"' _ {} \; + # Remove old python directories before recreating them + find "$install_dir/lib/" -mindepth 1 -maxdepth 1 -type d -name "python*" -not -path "*/python${py_required_version%.*}" -exec bash -c 'rm -Rf "$1"' _ {} \; + find "$install_dir/include/site/" -mindepth 1 -maxdepth 1 -type d -name "python*" -not -path "*/python${py_required_version%.*}" -exec bash -c 'rm -Rf "$1"' _ {} \; + # Upgrade the virtual environment directory ynh_exec_as $app $py_app_version -m venv --upgrade "$install_dir" }