ttrss: Completely uninstall app

Set debconf values so that the database gets dropped when the package is removed

Tests:

* Install App and subscribe to a feed
* Apply patches, then reinstall app: confirm the feed is purged
* Functional tests passed

Signed-off-by: nbenedek <contact@nbenedek.me>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
nbenedek 2023-04-09 19:46:55 +02:00 committed by Sunil Mohan Adapa
parent 82101cc9b3
commit e3c285c4cb
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2
2 changed files with 5 additions and 2 deletions

View File

@ -36,7 +36,7 @@ class TTRSSApp(app_module.App):
app_id = 'ttrss'
_version = 3
_version = 4
def __init__(self):
"""Create components for the app."""

View File

@ -20,7 +20,10 @@ DB_BACKUP_FILE = '/var/lib/plinth/backups-data/ttrss-database.sql'
def pre_setup():
"""Preseed debconf values before packages are installed."""
action_utils.debconf_set_selections(
['tt-rss tt-rss/database-type string pgsql'])
['tt-rss tt-rss/database-type string pgsql',
'tt-rss tt-rss/purge boolean true',
'tt-rss tt-rss/dbconfig-remove boolean true',
'tt-rss tt-rss/dbconfig-reinstall boolean true'])
@privileged