From 191520ebddc7b0171fc36d552cc0aafcf3354e92 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Fri, 5 May 2023 19:22:37 +0200 Subject: [PATCH] mysql: dirty/ugly patch to autoinstall mariadb-server when calling ynhmysql_setup_db when it's not installed --- helpers/mysql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helpers/mysql b/helpers/mysql index a5290f794..c9629537b 100644 --- a/helpers/mysql +++ b/helpers/mysql @@ -210,6 +210,9 @@ ynh_mysql_setup_db() { # If $db_pwd is not provided, use new_db_pwd instead for db_pwd db_pwd="${db_pwd:-$new_db_pwd}" + # Dirty patch for super-legacy apps + dpkg --list | grep -q "^ii mariadb-server" || { ynh_print_warn "Packager: you called ynh_mysql_setup_db without declaring a dependency to mariadb-server. Please add it to your apt dependencies !"; apt install mariadb-server --no-install-recommends -y; } + ynh_mysql_create_db "$db_name" "$db_user" "$db_pwd" ynh_app_setting_set --app=$app --key=mysqlpwd --value=$db_pwd }