This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Configure should avoid looping infinitely repeating the same question
authorH.Merijn Brand <perl5@tux.freedom.nl>
Thu, 25 Aug 2022 12:30:44 +0000 (14:30 +0200)
committerH.Merijn Brand <perl5@tux.freedom.nl>
Thu, 25 Aug 2022 12:30:44 +0000 (14:30 +0200)
commitc351c081fa9797334cbdbd9a3bb6f2e2dfda51a2
tree895dc6470b6717461039d166574c83d8f67f50a6
parentc89094fa17c2835ca57af0d173e828bd5aabbc19
Configure should avoid looping infinitely repeating the same question

Backport of 46bfb3c49f22629a21d99ff2d02461a2a8a9aac4
Author: Nicholas Clark <nick@ccl4.org>
Date:   Tue Aug 2 16:40:39 2022 +0200

Configure's helper function ./myread is intended to loop until it gets an
acceptable answer. For a couple of cases, an empty string is not acceptable
(eg 'Where is your C library?', if all automated attempts at answering this
have failed). In these cases, if Configure's standard input is /dev/null (or
closed), the shell read returns an empty string, and ./myread repeats the
question.
Before this commit, it would loop infinitely (generating continuous terminal
output). With this commit, we add a retry counter - if it asks the same
question to many times, it aborts Configure. This means that unattended
./Configure runs should now always terminate, as termination with an error
is better than spinning forever.
U/modified/Myread.U [new file with mode: 0644]