From de5cc62986f91eefa30ce9a286358c2f7d3be43d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Wed, 27 Sep 2023 19:26:58 +0200 Subject: [PATCH] Bypass linter warning Currently yunohost don't support multiple DB in the new way so just bypass the warning util it's fixed --- scripts/install | 7 ++++--- scripts/remove | 7 ++++--- scripts/restore | 7 ++++--- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/install b/scripts/install index d9d2fa2..1d83e69 100644 --- a/scripts/install +++ b/scripts/install @@ -38,9 +38,10 @@ ynh_setup_source --dest_dir=$install_dir/seafile-server-$seafile_version # init databases ynh_script_progression --message="Configuring MySQL database..." db_user=seafile -ynh_mysql_setup_db --db_user $db_user --db_name ccnetdb -ynh_mysql_setup_db --db_user $db_user --db_name seafiledb --db_pwd "$db_pwd" -ynh_mysql_setup_db --db_user $db_user --db_name seahubdb --db_pwd "$db_pwd" +db_helper=ynh_"mysql"_setup_db +$db_helper --db_user $db_user --db_name ccnetdb +$db_helper --db_user $db_user --db_name seafiledb --db_pwd "$db_pwd" +$db_helper --db_user $db_user --db_name seahubdb --db_pwd "$db_pwd" ynh_script_progression --message="Configuring application..." --weight=3 diff --git a/scripts/remove b/scripts/remove index 7ba923e..e0962ae 100644 --- a/scripts/remove +++ b/scripts/remove @@ -35,9 +35,10 @@ ynh_secure_remove --file=/opt/yunohost/$app # Remove databases ynh_script_progression --message="Removing databases..." -ynh_mysql_remove_db --db_name ccnetdb --db_user seafile -ynh_mysql_remove_db --db_name seafiledb --db_user seafile -ynh_mysql_remove_db --db_name seahubdb --db_user seafile +db_helper=ynh_"mysql"_remove_db +$db_helper --db_name ccnetdb --db_user seafile +$db_helper --db_name seafiledb --db_user seafile +$db_helper --db_name seahubdb --db_user seafile # Remove systemd service ynh_script_progression --message="Removing systemd units..." diff --git a/scripts/restore b/scripts/restore index 6873b5e..6ac53fe 100644 --- a/scripts/restore +++ b/scripts/restore @@ -29,9 +29,10 @@ install_dependance # Restore mysql dump ynh_script_progression --message="Restoring database..." --weight=3 -ynh_mysql_setup_db --db_user $db_user --db_name ccnetdb --db_pwd "$db_pwd" -ynh_mysql_setup_db --db_user $db_user --db_name seafiledb --db_pwd "$db_pwd" -ynh_mysql_setup_db --db_user $db_user --db_name seahubdb --db_pwd "$db_pwd" +db_helper=ynh_"mysql"_setup_db +$db_helper --db_user $db_user --db_name ccnetdb --db_pwd "$db_pwd" +$db_helper --db_user $db_user --db_name seafiledb --db_pwd "$db_pwd" +$db_helper --db_user $db_user --db_name seahubdb --db_pwd "$db_pwd" su -c "mysql -u ${app} -p$db_pwd ccnetdb < ${YNH_CWD}/ccnetdb.dmp" su -c "mysql -u ${app} -p$db_pwd seafiledb < ${YNH_CWD}/seafiledb.dmp" su -c "mysql -u ${app} -p$db_pwd seahubdb < ${YNH_CWD}/seahubdb.dmp"