Fixed issue with MariaDB and Debian 13

see #598
This commit is contained in:
Antoine Nguyen
2025-09-24 11:05:09 +02:00
parent 5a6f5e7d71
commit 65961209c8

View File

@@ -3,6 +3,7 @@
import os import os
import pwd import pwd
import stat import stat
from typing import Optional
from . import package from . import package
from . import system from . import system
@@ -13,9 +14,9 @@ class Database(object):
"""Common database backend.""" """Common database backend."""
default_port = None default_port: Optional[int] = None
packages = None packages: Optional[dict[str, list[str]]] = None
service = None service: Optional[str] = None
def __init__(self, config): def __init__(self, config):
"""Install if necessary.""" """Install if necessary."""
@@ -36,7 +37,6 @@ class Database(object):
class PostgreSQL(Database): class PostgreSQL(Database):
"""Postgres.""" """Postgres."""
default_port = 5432 default_port = 5432
@@ -188,7 +188,7 @@ class MySQL(Database):
self.packages["deb"].append("libmariadb-dev") self.packages["deb"].append("libmariadb-dev")
else: else:
self.packages["deb"].append("libmysqlclient-dev") self.packages["deb"].append("libmysqlclient-dev")
super(MySQL, self).install_package() super().install_package()
queries = [] queries = []
if name.startswith("debian"): if name.startswith("debian"):
if version.startswith("8"): if version.startswith("8"):
@@ -200,7 +200,7 @@ class MySQL(Database):
self.dbpassword) self.dbpassword)
return return
if ( if (
(name.startswith("debian") and (version.startswith("11") or version.startswith("12"))) or (name.startswith("debian") and int(version[:2]) >= 11) or
(name.startswith("ubuntu") and int(version[:2]) >= 22) (name.startswith("ubuntu") and int(version[:2]) >= 22)
): ):
queries = [ queries = [