You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2013/07/28 23:28:24 UTC

svn commit: r1507851 - /subversion/trunk/subversion/tests/cmdline/davautocheck.sh

Author: danielsh
Date: Sun Jul 28 21:28:24 2013
New Revision: 1507851

URL: http://svn.apache.org/r1507851
Log:
davautocheck.sh: When running under something other than bash, teach the
prompt to exit as soon as something is available on stdin.  (Previously,
on FreeBSD, just answering "y\n" to the prompt would not be immediately
recognized.)

Thanks to gstein and peters for feedback.

* subversion/tests/cmdline/davautocheck.sh
  (query): Juggle a little to ensure that the terminal is in cbreak mode for
    the propmt.

Modified:
    subversion/trunk/subversion/tests/cmdline/davautocheck.sh

Modified: subversion/trunk/subversion/tests/cmdline/davautocheck.sh
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/davautocheck.sh?rev=1507851&r1=1507850&r2=1507851&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/davautocheck.sh (original)
+++ subversion/trunk/subversion/tests/cmdline/davautocheck.sh Sun Jul 28 21:28:24 2013
@@ -113,13 +113,17 @@ query() {
     read -n 1 -t 32
   else
     # 
-    prog=$(cat) <<'EOF'
+    prog="
 import select as s
 import sys
+import tty, termios
+tty.setcbreak(sys.stdin.fileno(), termios.TCSANOW)
 if s.select([sys.stdin.fileno()], [], [], 32)[0]:
   sys.stdout.write(sys.stdin.read(1))
-EOF
-    REPLY=`stty cbreak; $PYTHON -c "$prog" "$@"; stty -cbreak`
+"
+    stty_state=`stty -g`
+    REPLY=`$PYTHON -u -c "$prog" "$@"`
+    stty $stty_state
   fi
   echo
   [ "${REPLY:-$2}" = 'y' ]