mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-25 09:21:10 +00:00
setup: Fix issue with pending app update and force upgrade
Closes: #2490 - When app update and force upgrade are pending on an app, app.setup() is run during initialization. During setup(), force upgrade is first run as expected. However, force upgrade does not do it's job when an app needs version upgrade. setup() then tries to run package install() for the app and fails because configuration file prompt is pending. Tests: - On a fresh bookworm container, update all packages. Run freedombox and ensure that first setup has been completed. Stop freedombox and increment the firewall app version. Then change sources.list and change bookworm to testing. Run apt update. Then start the fredombox service. Notice that firewall app setup is run. During the setup, force upgrader is executed. It install the newer firewall package with the newer configuration file and performs the configuration file changes. After that setup process continues and completes successfully. firewalld package has been upgraded from 1.3.x to 2.3.x. firewalld service is running. In /etc/firewalld/firewalld.conf default zone is set to external and backend is set to nftables. - Rerun the above test without the patches and notice that force upgrader does not recognize firewall as a package to upgrade and setup() fails when trying to install() packages. This is run in a loop continuously. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
eaed05e02b
commit
fa57610b07
@ -647,9 +647,13 @@ class ForceUpgrader():
|
||||
# App does not implement force upgrade
|
||||
continue
|
||||
|
||||
if (app.get_setup_state() != app_module.App.SetupState.UP_TO_DATE):
|
||||
# App is not installed.
|
||||
# Or needs an update, let it update first.
|
||||
if (app.get_setup_state() == app_module.App.SetupState.NEEDS_SETUP
|
||||
):
|
||||
# If an app is not installed don't considered it. If an app
|
||||
# needs an update, it may have to do a force upgrade before
|
||||
# running app version update. This is because the app version
|
||||
# update process will include installing packages that will
|
||||
# fail due to pending configuration file updates.
|
||||
continue
|
||||
|
||||
for component in app.get_components_of_type(Packages):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user