Skip to content

Commit

Permalink
Trac #20884: line buffering in sage-logger causes "hang" due to invis…
Browse files Browse the repository at this point in the history
…ible prompt when installing experimental packages

(Observed on Mac OS X.)

As I reported in http://trac.sagemath.org/ticket/20708#comment:8:

When installing an "experimental" package, Sage warns a lot and then
prompts the user.
Because of line buffering, one does not see the prompt, but Sage just
waits indefinitely.
{{{
sage -f latte_int
...
[latte_int-1.7.3] =========================== WARNING
===========================
[latte_int-1.7.3] You are about to download and install an experimental
package.
[latte_int-1.7.3] This probably won't work at all for you! There is no
guarantee
[latte_int-1.7.3] that it will build correctly, or behave as expected.
[latte_int-1.7.3] Use at your own risk!
[latte_int-1.7.3]
===============================================================
}}}
<--- This is where it asks "[latte_int-1.7.3] Are you sure you want to
continue [Y/n]?" but this is line-buffered and not visible to the user.

URL: https://trac.sagemath.org/20884
Reported by: mkoeppe
Ticket author(s): Matthias Koeppe
Reviewer(s): Leif Leonhardy, Volker Braun
  • Loading branch information
Release Manager authored and vbraun committed Jul 22, 2016
2 parents cadb3b6 + 6888a67 commit bcece2c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions build/bin/sage-spkg
Expand Up @@ -272,7 +272,8 @@ elif [ -z "$PKG_HAS_PATH" ]; then
echo "that it will build correctly, or behave as expected."
echo "Use at your own risk!"
echo "==============================================================="
read -p "Are you sure you want to continue [Y/n]? " answer
echo "Are you sure you want to continue [Y/n]?"
read -p "Answer: " answer
case "$answer" in
n*|N*) exit 0;;
esac
Expand Down Expand Up @@ -365,7 +366,8 @@ if [ ! -f "$PKG_SRC" ]; then
echo "For more information about making Sage packages, see"
echo "http://doc.sagemath.org/html/en/developer/packaging.html"
echo "=========================================================================="
read -p "Are you sure you want to continue [Y/n]? " answer
echo "Are you sure you want to continue [Y/n]?"
read -p "Answer: " answer
case "$answer" in
n*|N*) exit 0;;
esac
Expand All @@ -381,7 +383,8 @@ if [ ! -f "$PKG_SRC" ]; then
echo "http://doc.sagemath.org/html/en/developer/packaging.html"
echo "=========================================================================="
echo
read -t 30 -p "Are you sure (automatically continuing in 30 seconds) [Y/n]? " answer
echo "Are you sure (automatically continuing in 30 seconds) [Y/n]?"
read -t 30 -p "Answer: " answer
case "$answer" in
n*|N*) exit 0;;
esac
Expand Down

0 comments on commit bcece2c

Please sign in to comment.