From ccdc4071dfc9907634fd8a08dd0a3c8bf71a62f7 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 28 May 2006 23:27:35 +0000 Subject: Revert patch for r3426 for bug 134466 and add warnings to docs. svn path=/main/trunk/; revision=3437 --- bin/emerge | 6 ++++-- man/emerge.1 | 4 ++++ pym/emergehelp.py | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/bin/emerge b/bin/emerge index 49f68a411..2b2a72fcb 100755 --- a/bin/emerge +++ b/bin/emerge @@ -109,7 +109,8 @@ def normpath(mystr): def userquery(prompt, responses=None, colours=None): """Displays a prompt and a set of responses, then waits for a response which is checked against the responses and the first to match is - returned. + returned. An empty response will match the first value in responses. The + input buffer is *not* cleared prior to the prompt! prompt: a String. responses: a List of Strings. @@ -133,7 +134,8 @@ def userquery(prompt, responses=None, colours=None): while True: response=raw_input("["+string.join([colours[i](responses[i]) for i in range(len(responses))],"/")+"] ") for key in responses: - if response and response.upper()==key[:len(response)].upper(): + # An empty response will match the first value in responses. + if response.upper()==key[:len(response)].upper(): return key print "Sorry, response '%s' not understood." % response, except (EOFError, KeyboardInterrupt): diff --git a/man/emerge.1 b/man/emerge.1 index 6e70c7459..5af1799a2 100644 --- a/man/emerge.1 +++ b/man/emerge.1 @@ -197,6 +197,10 @@ in the same format as when using \fB\-\-pretend\fR; then ask whether to continue with the merge or abort. Using \fB\-\-ask\fR is more efficient than using \fB\-\-pretend\fR and then executing the same command without \fB\-\-pretend\fR, as dependencies will only need to be calculated once. +\fBWARNING: If the "Enter" key is pressed at the prompt (with no other input), +it is interpreted as acceptance of the first choice. Note that the input +buffer is not cleared prior to the prompt, so an accidental press of the +"Enter" key at any time prior to the prompt will be interpreted as a choice!\fR .TP .BR "\-\-buildpkg " (\fB\-b\fR) Tells emerge to build binary packages for all ebuilds processed in diff --git a/pym/emergehelp.py b/pym/emergehelp.py index 7bb554f3f..94f4d6732 100644 --- a/pym/emergehelp.py +++ b/pym/emergehelp.py @@ -157,7 +157,11 @@ def help(myaction,myopts,havecolor=1): print " ask whether to continue with the merge or abort. Using --ask is" print " more efficient than using --pretend and then executing the same" print " command without --pretend, as dependencies will only need to be" - print " calculated once." + print " calculated once. WARNING: If the \"Enter\" key is pressed at the" + print " prompt (with no other input), it is interpreted as acceptance of" + print " the first choice. Note that the input buffer is not cleared prior" + print " to the prompt, so an accidental press of the \"Enter\" key at any" + print " time prior to the prompt will be interpreted as a choice!" print print " "+green("--buildpkg")+" ("+green("-b")+" short option)" print " Tell emerge to build binary packages for all ebuilds processed" -- cgit v1.2.3-1-g7c22