mirror of
https://github.com/YunoHost-Apps/homeassistant_ynh.git
synced 2024-09-03 19:26:16 +02:00
Fix #360
This commit is contained in:
parent
7f1bf807df
commit
eeaf801b7e
1 changed files with 20 additions and 11 deletions
|
@ -160,16 +160,25 @@ myynh_install_homeassistant () {
|
||||||
myynh_upgrade_venv_directory () {
|
myynh_upgrade_venv_directory () {
|
||||||
|
|
||||||
# Remove old python links before recreating them
|
# Remove old python links before recreating them
|
||||||
find "$install_dir/bin/" -type l -name 'python*' \
|
if [ -e "$install_dir/bin/" ]
|
||||||
-exec bash -c 'rm --force "$1"' _ {} \;
|
then
|
||||||
|
find "$install_dir/bin/" -type l -name 'python*' \
|
||||||
|
-exec bash -c 'rm --force "$1"' _ {} \;
|
||||||
|
fi
|
||||||
|
|
||||||
# Remove old python directories before recreating them
|
# Remove old python directories before recreating them
|
||||||
find "$install_dir/lib/" -mindepth 1 -maxdepth 1 -type d -name "python*" \
|
if [ -e "$install_dir/lib/" ]
|
||||||
-not -path "*/python${py_required_version%.*}" \
|
then
|
||||||
-exec bash -c 'rm --force --recursive "$1"' _ {} \;
|
find "$install_dir/lib/" -mindepth 1 -maxdepth 1 -type d -name "python*" \
|
||||||
find "$install_dir/include/site/" -mindepth 1 -maxdepth 1 -type d -name "python*" \
|
-not -path "*/python${py_required_version%.*}" \
|
||||||
-not -path "*/python${py_required_version%.*}" \
|
-exec bash -c 'rm --force --recursive "$1"' _ {} \;
|
||||||
-exec bash -c 'rm --force --recursive "$1"' _ {} \;
|
fi
|
||||||
|
if [ -e "$install_dir/include/site/" ]
|
||||||
|
then
|
||||||
|
find "$install_dir/include/site/" -mindepth 1 -maxdepth 1 -type d -name "python*" \
|
||||||
|
-not -path "*/python${py_required_version%.*}" \
|
||||||
|
-exec bash -c 'rm --force --recursive "$1"' _ {} \;
|
||||||
|
fi
|
||||||
|
|
||||||
# Upgrade the virtual environment directory
|
# Upgrade the virtual environment directory
|
||||||
ynh_exec_as $app $py_app_version -m venv --upgrade "$install_dir"
|
ynh_exec_as $app $py_app_version -m venv --upgrade "$install_dir"
|
||||||
|
@ -184,11 +193,11 @@ myynh_set_permissions () {
|
||||||
chown -R $app: "$data_dir"
|
chown -R $app: "$data_dir"
|
||||||
chmod 750 "$data_dir"
|
chmod 750 "$data_dir"
|
||||||
chmod -R o-rwx "$data_dir"
|
chmod -R o-rwx "$data_dir"
|
||||||
[ ! -e "$data_dir/bin/" ] || chmod -R +x "$data_dir/bin/"
|
[ -e "$data_dir/bin/" ] && chmod -R +x "$data_dir/bin/"
|
||||||
|
|
||||||
[ ! -e "$(dirname "$log_file")" ] || chown -R $app: "$(dirname "$log_file")"
|
[ -e "$(dirname "$log_file")" ] && chown -R $app: "$(dirname "$log_file")"
|
||||||
|
|
||||||
[ ! -e "/etc/sudoers.d/$app" ] || chown -R root: "/etc/sudoers.d/$app"
|
[ -e "/etc/sudoers.d/$app" ] && chown -R root: "/etc/sudoers.d/$app"
|
||||||
|
|
||||||
# Upgade user groups
|
# Upgade user groups
|
||||||
user_groups=""
|
user_groups=""
|
||||||
|
|
Loading…
Reference in a new issue