package: Helper method to filter packages that need conffile prompt

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 2019-02-26 06:24:17 -05:00
1 parent 5b4aa1cda0
commit c8b2ba8c99
1 file changed
+9
+9
View File
@@ -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)