From fdaba80de345af0d7db25ee6643ff7fe48b3f8bb Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 15 Mar 2024 16:13:54 -0700 Subject: [PATCH] ttrss: Ensure that database is removed after uninstall - Setting ttrss/purge to 'true' in debconf is not retrained after the package has been install. So, set it again just before package removal. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/ttrss/__init__.py | 5 +++++ plinth/modules/ttrss/privileged.py | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/plinth/modules/ttrss/__init__.py b/plinth/modules/ttrss/__init__.py index de9f53f3a..945f2bb6b 100644 --- a/plinth/modules/ttrss/__init__.py +++ b/plinth/modules/ttrss/__init__.py @@ -120,6 +120,11 @@ class TTRSSApp(app_module.App): if not old_version: self.enable() + def uninstall(self): + """De-configure and uninstall the app.""" + privileged.uninstall() + super().uninstall() + def force_upgrade(self, packages): """Force update package to resolve conffile prompts.""" if 'tt-rss' not in packages: diff --git a/plinth/modules/ttrss/privileged.py b/plinth/modules/ttrss/privileged.py index 4d2526826..5af79a56f 100644 --- a/plinth/modules/ttrss/privileged.py +++ b/plinth/modules/ttrss/privileged.py @@ -171,3 +171,11 @@ def load_augeas(): aug.set('/augeas/load/Phpvars/incl[last() + 1]', DATABASE_FILE) aug.load() return aug + + +@privileged +def uninstall(): + """Ensure that the database is removed.""" + # This setting set before deb package installation is not retrained, + # somehow. + action_utils.debconf_set_selections(['tt-rss tt-rss/purge boolean true'])