From c8b2ba8c99da922bbcd3d24d3cb0e7e97c507701 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sun, 24 Feb 2019 18:45:12 -0800 Subject: [PATCH] package: Helper method to filter packages that need conffile prompt Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/package.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plinth/package.py b/plinth/package.py index 2e7b1c13b..a50a87092 100644 --- a/plinth/package.py +++ b/plinth/package.py @@ -18,6 +18,7 @@ Framework for installing and updating distribution packages """ +import json import logging import subprocess import threading @@ -183,3 +184,11 @@ def refresh_package_lists(): """To be run in case apt package lists are outdated.""" transaction = Transaction(None, None) transaction.refresh_package_lists() + + +def filter_conffile_prompts(packages): + """Return a filtered list of packages that require conffile prompts.""" + response = actions.superuser_run( + 'packages', + ['filter-conffile-packages', '--packages'] + list(packages)) + return json.loads(response)