minetest: Create the configuration directory if necessary for Trixie

Closes: #2514

- On Trixie the configuration directory is /etc/luanti and not /etc/minetest.
So, it needs to be created.

Tests:

- On Trixie and Bookworm, updating configuration works. On Trixie, directory is
created if it does not exist.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2025-04-28 14:17:56 -07:00 committed by James Valleroy
parent daa7c326b8
commit 8c6c31d991
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -1,6 +1,8 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Configure Minetest server."""
import pathlib
import augeas
from plinth import action_utils
@ -15,6 +17,7 @@ def configure(max_players: int | None = None, enable_pvp: bool | None = None,
creative_mode: bool | None = None,
enable_damage: bool | None = None):
"""Update configuration file and restart daemon if necessary."""
pathlib.Path(CONFIG_FILE).parent.mkdir(exist_ok=True)
aug = load_augeas()
if max_players is not None:
aug.set(AUG_PATH + '/max_users', str(max_players))