uninstall: Use reverse order when uninstalling components

Tests:

- Functional tests for bepasty app work.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2025-05-30 15:13:59 -04:00
1 parent ad2908630c
commit 3b1eba216a
2 files changed
+5 -3

No files matched your search

+3 -1
View File
@@ -147,7 +147,9 @@ class App:
def uninstall(self):
"""De-configure and uninstall the app."""
for component in self.components.values():
# Remove components in the reverse order so that dependencies among
# components is properly satisfied.
for component in reversed(self.components.values()):
component.uninstall()
def get_setup_state(self) -> SetupState:
+2 -2
View File
@@ -264,8 +264,8 @@ def test_packages_uninstall_exclusion(cache, uninstall,
TestApp3()
app1.uninstall()
uninstall.assert_has_calls([
call(['package11', 'package3', 'dep6'], purge=True),
call(['package12', 'package3'], purge=True)
call(['package12', 'package3'], purge=True),
call(['package11', 'package3', 'dep6'], purge=True)
])