From e6054998f0b5c2ae3aadf3735b37004356c70b96 Mon Sep 17 00:00:00 2001 From: tradke Date: Sun, 20 Jun 2004 12:22:20 +0000 Subject: Fix evaluation of user input on "yes/no" prompts. This closes PR Cactus/1776: "Answering "no" to "create configuration?" does not abort". git-svn-id: http://svn.cactuscode.org/flesh/trunk@3770 17b73243-c579-4c4c-a9d2-2d5706c11dac --- Makefile | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 24c61174..a57007a8 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ # # # @enddesc -# @version $Id: Makefile,v 1.158 2004-06-20 12:18:48 tradke Exp $ +# @version $Id: Makefile,v 1.159 2004-06-20 12:22:20 tradke Exp $ # @@*/ ################################################################################## @@ -582,14 +582,10 @@ $(addsuffix -delete,$(CONFIGURATIONS)): @echo $(DIVIDER) if test "x$(DELETE_CONFIRMATION)" = "xyes" ; then \ echo "Really delete configuration $(@:%-delete=%) (no)?";\ - if ( ! read yesno rest ); then \ - yesno='no'; \ - fi; \ - if test "x$$yesno" = "xyes" ; then \ - confirm=yes ; \ - else \ - confirm=no ; \ - fi ; \ + read confirm rest; \ + if test $$? -ne 0 ; then \ + confirm='no'; \ + fi; \ else \ confirm=yes ; \ fi ; \ @@ -728,9 +724,10 @@ endif @echo Configuration $(@:%-config=%) does not exist.; if test "x$(PROMPT)" = "xyes" ; then \ echo Setup configuration $(@:%-config=%) \(yes\)?; \ - if ( ! read yesno rest ); then \ - yesno='no'; \ - fi; \ + read yesno rest; \ + if test $$? -ne 0 ; then \ + yesno='no'; \ + fi; \ fi; \ if [ "x$$yesno" = "xno" -o "x$$yesno" = "xn" -o "x$$yesno" = "xNO" -o "x$$yesno" = "xN" ] ;\ then \ @@ -1131,7 +1128,8 @@ cvsdiff: downsize: @echo $(DIVIDER) @echo Remove flesh and thorn documentation \(\no\)? - if ( ! read yesno rest ); then \ + read yesno rest; \ + if test $$? -ne 0 ; then \ yesno='no'; \ fi; \ if [ "x$$yesno" = "xyes" -o "x$$yesno" = "xy" -o "x$$yesno" = "xYES" -o "x$$yesno" = "xY" ] ;\ @@ -1140,7 +1138,8 @@ downsize: echo $(DIVIDER) ; \ fi @echo Remove thorn testsuites \(\no\)? - if ( ! read yesno rest ); then \ + read yesno rest; \ + if test $$? -ne 0 ; then \ yesno='no'; \ fi; \ if [ "x$$yesno" = "xyes" -o "x$$yesno" = "xy" -o "x$$yesno" = "xYES" -o "x$$yesno" = "xY" ] ;\ @@ -1149,7 +1148,8 @@ downsize: echo $(DIVIDER) ; \ fi @echo Remove all configurations \(\no\)? - if ( ! read yesno rest ); then \ + read yesno rest; \ + if test $$? -ne 0 ; then \ yesno='no'; \ fi; \ if [ "x$$yesno" = "xyes" -o "x$$yesno" = "xy" -o "x$$yesno" = "xYES" -o "x$$yesno" = "xY" ] ;\ @@ -1165,9 +1165,10 @@ downsize: @echo "Cactus - version: $(CCTK_VERSION)" if test "x$(PROMPT)" = "xyes" ; then \ echo Setup configuration $@ \(yes\)?; \ - if ( ! read yesno rest ); then \ - yesno='no'; \ - fi; \ + read yesno rest; \ + if test $$? -ne 0 ; then \ + yesno='no'; \ + fi; \ fi; \ if [ "x$$yesno" = "xno" -o "x$$yesno" = "xn" -o "x$$yesno" = "xNO" -o "x$$yesno" = "xN" ] ; \ then \ -- cgit v1.2.3