From 65c433a2112641d3b3ac87a34c44d8d59db0683a Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Thu, 15 Sep 2022 07:43:19 -0700 Subject: [PATCH] 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 Reviewed-by: James Valleroy --- plinth/action_utils.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/plinth/action_utils.py b/plinth/action_utils.py index ffaad50d1..3247fb90c 100644 --- a/plinth/action_utils.py +++ b/plinth/action_utils.py @@ -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