mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
action_utils: Drop unused progress requests from apt-get
Tests: - All tests in patch series have been done with this patch applied - Install and uninstall of apps works Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
5c5fc9eb61
commit
65c433a211
@ -405,21 +405,12 @@ def is_disk_image():
|
||||
|
||||
def run_apt_command(arguments):
|
||||
"""Run apt-get with provided arguments."""
|
||||
# Ask apt-get to output its progress to file descriptor 3.
|
||||
command = [
|
||||
'apt-get', '--assume-yes', '--quiet=2', '--option', 'APT::Status-Fd=3'
|
||||
] + arguments
|
||||
command = ['apt-get', '--assume-yes', '--quiet=2'] + arguments
|
||||
|
||||
# Duplicate stdout to file descriptor 3 for this process.
|
||||
os.dup2(1, 3)
|
||||
|
||||
# Pass on file descriptor 3 instead of closing it. Close stdout
|
||||
# so that regular output is ignored.
|
||||
env = os.environ.copy()
|
||||
env['DEBIAN_FRONTEND'] = 'noninteractive'
|
||||
process = subprocess.run(command, stdin=subprocess.DEVNULL,
|
||||
stdout=subprocess.DEVNULL, close_fds=False,
|
||||
env=env, check=False)
|
||||
stdout=subprocess.DEVNULL, env=env, check=False)
|
||||
return process.returncode
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user