Update MySQL (MariaDB) install to account for Ubuntu 24.04.

This commit is contained in:
phizev
2025-06-01 17:41:39 +02:00
parent 1e4ba06764
commit daf3ec2d42

View File

@@ -184,7 +184,7 @@ class MySQL(Database):
self.packages["deb"].append("libmariadbclient-dev") self.packages["deb"].append("libmariadbclient-dev")
elif name == "ubuntu": elif name == "ubuntu":
if version.startswith("2"): if version.startswith("2"):
# Works for Ubuntu 22 and 20 # Works for Ubuntu 20, 22, and 24.
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")
@@ -201,7 +201,7 @@ class MySQL(Database):
return return
if ( if (
(name.startswith("debian") and (version.startswith("11") or version.startswith("12"))) or (name.startswith("debian") and (version.startswith("11") or version.startswith("12"))) or
(name.startswith("ubuntu") and version.startswith("22")) (name.startswith("ubuntu") and int(version[:2]) >= 22)
): ):
queries = [ queries = [
"SET PASSWORD FOR 'root'@'localhost' = PASSWORD('{}')" "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('{}')"