mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
action_utils: Workaround problem with setting debconf answers
Closes: #1303. Test: Reproduce the problem with debconf-set-selections. Install tt-rss. run debconf-set apt install tt-rss echo 'tt-rss tt-rss/database-type string pgsql' | debconf-set-selections apt purge tt-rss echo 'tt-rss tt-rss/database-type string pgsql' | debconf-set-selections error: Cannot find a question for tt-rss/database-type Then run try to install ttrss without patch and observe that it fails. Apply the patch and see that ttrss is installed properly. Observe that database configured in /etc/ttrss/database.php is 'pgsql'. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
ca8ea9427c
commit
1de2b96bc4
@ -531,6 +531,14 @@ Owners: {package}
|
||||
|
||||
def debconf_set_selections(presets):
|
||||
"""Answer debconf questions before installing a package."""
|
||||
try:
|
||||
# Workaround Debian Bug #487300. In some situations, debconf complains
|
||||
# it can't find the question being answered even though it is supposed
|
||||
# to create a dummy question for it.
|
||||
subprocess.run(['/usr/share/debconf/fix_db.pl'], check=True)
|
||||
except (FileNotFoundError, PermissionError):
|
||||
pass
|
||||
|
||||
presets = '\n'.join(presets)
|
||||
subprocess.check_output(['debconf-set-selections'], input=presets.encode())
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user