firewalld: Implement force upgrading to any 2.x versions

Closes: #2396.

New configuration options were introduced from 1.3.x to 2.1.x. This cause
configuration file prompt due to our existing changes to the configuration file.
Changes to the configuration file were investigated in #2396.

Tests:

- Install firewalld 1.3.x. Ensure that firewalld configuration changes are
present as intended by FreedomBox. Change priority of the .deb package to allow
installing 2.1.x. Run apt update and notice that force upgrade has been
performed to 2.1.x.

- firewalld upgrade has also been tested as part of this patch series.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2024-02-14 16:50:09 -08:00 committed by James Valleroy
parent bd4ddcf158
commit 5e10b2d4ae
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -87,9 +87,9 @@ class FirewallApp(app_module.App):
if 'firewalld' not in packages: if 'firewalld' not in packages:
return False return False
# Allow upgrade from any version to any version below 2.0 # Allow upgrade from any version to any version below 3.0
package = packages['firewalld'] package = packages['firewalld']
if Version(package['new_version']) > Version('2~'): if Version(package['new_version']) > Version('3~'):
return False return False
install(['firewalld'], force_configuration='new') install(['firewalld'], force_configuration='new')