From 36bf3730b6e431e6d6ba19bbdeee444f385e529f Mon Sep 17 00:00:00 2001 From: Todd Zullinger Date: Mon, 7 May 2018 12:16:37 -0400 Subject: [PATCH] completion: avoid potential hangs in dnf_commands_helper() The completion helper can hang indefinitely waiting for user input (which the user cannot see). The --assumeno option ensures any prompts are answered negatively. Using the --nogpgcheck option avoids the helper downloading gpgkeys for repos which have repo_gpgcheck=1 set. This can speed up the completion quite a bit. Lastly, redirect input from /dev/null to ensure the completion_helper command knows it has no controlling tty on which to wait for input. Closes: #894 Approved by: m-blaha --- etc/bash_completion.d/dnf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/bash_completion.d/dnf b/etc/bash_completion.d/dnf index 002f83ef10..7ae6f2eb9e 100644 --- a/etc/bash_completion.d/dnf +++ b/etc/bash_completion.d/dnf @@ -120,7 +120,7 @@ _dnf_set_python_exec() _dnf_commands_helper() { - echo "$( ${__dnf_python_exec} -c "import sys; from dnf.cli import completion_helper as ch; ch.main(sys.argv[1:])" "$@" -d 0 -q -C 2>/dev/null )" + echo "$( ${__dnf_python_exec} -c "import sys; from dnf.cli import completion_helper as ch; ch.main(sys.argv[1:])" "$@" -d 0 -q -C --assumeno --nogpgcheck 2>/dev/null