mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
minetest: Handle upgrade from 5.3.0 to 5.6.1
Closes: #2134. Tests: 1. In testing container, install Minetest and change the configuration. 2. Manually downgrade minetest-server and minetest-data to a slightly older version (5.5.0+dfsg+~1.9.0mt4+dfsg-1). 3. In /var/lib/dpkg/status, change the hash for /etc/minetest/minetest.conf. 4. Run "apt update". - minetest-server package is upgraded. - Configuration changes are kept. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
b1b457a65f
commit
e3c623b471
@ -11,10 +11,10 @@ from plinth.daemon import Daemon
|
||||
from plinth.modules.backups.components import BackupRestore
|
||||
from plinth.modules.firewall.components import Firewall
|
||||
from plinth.modules.users.components import UsersAndGroups
|
||||
from plinth.package import Package, Packages
|
||||
from plinth.utils import format_lazy
|
||||
from plinth.package import Package, Packages, install
|
||||
from plinth.utils import Version, format_lazy
|
||||
|
||||
from . import manifest
|
||||
from . import manifest, privileged
|
||||
|
||||
_mods = [
|
||||
Package('minetest-mod-3d-armor') | Package('minetest-mod-player-3d-armor'),
|
||||
@ -98,6 +98,22 @@ class MinetestApp(app_module.App):
|
||||
super().setup(old_version)
|
||||
self.enable()
|
||||
|
||||
def force_upgrade(self, packages):
|
||||
"""Force upgrade minetest to resolve conffile prompt."""
|
||||
if 'minetest-server' not in packages:
|
||||
return False
|
||||
|
||||
# Allow upgrade from 5.3.0 to 5.6.1
|
||||
package = packages['minetest-server']
|
||||
if Version(package['new_version']) > Version('5.7~'):
|
||||
return False
|
||||
|
||||
config = get_configuration()
|
||||
install(['minetest-server'], force_configuration='new')
|
||||
privileged.configure(**config)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def load_augeas():
|
||||
"""Initialize Augeas."""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user