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