guix-install.sh: Restore compatibility with "yes" invocation.
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>
Tue, 11 Oct 2022 15:49:37 +0000 (11:49 -0400)
committerMaxim Cournoyer <maxim.cournoyer@gmail.com>
Tue, 11 Oct 2022 16:00:44 +0000 (12:00 -0400)
commite46bb5fd5af3adb931e0930326c60a7c2e4cbe4e
treed5785e3dcf7ed1f5ed15726cd2c5ec5c59ee7671
parent68d79a8b60a1a564a8425de8220fb65dc79ba9ee
guix-install.sh: Restore compatibility with "yes" invocation.

Commit 6a2e303d3a had modified prompt_yes_no to only read a single character,
aiming to ease the user experience.  This was, in retrospect, a bad idea, as
it makes user input error more likely and introduces complexity.

This commit reverts to line-oriented input, while preserving the default yes
value so that a user can simply hit 'Enter' at the prompt in place of typing
"yes".

* etc/guix-install.sh (_flush): Delete function.
(prompt_yes_no): Restore line-oriented read.  Remove loop.  Make anything else
than yes means no.  Use Bash features to streamline definition.

Reported-by: Lars-Dominik Braun <lars@6xq.net> and others.
etc/guix-install.sh