summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-05-28 23:27:35 +0000
committerZac Medico <zmedico@gentoo.org>2006-05-28 23:27:35 +0000
commitccdc4071dfc9907634fd8a08dd0a3c8bf71a62f7 (patch)
treefe3724bd87fcdf4fb262dbf171570315fcc1435f
parent0d04fd8249ea36d4b8153fa4c33c3dfb2977146c (diff)
downloadportage-ccdc4071dfc9907634fd8a08dd0a3c8bf71a62f7.tar.gz
portage-ccdc4071dfc9907634fd8a08dd0a3c8bf71a62f7.tar.bz2
portage-ccdc4071dfc9907634fd8a08dd0a3c8bf71a62f7.zip
Revert patch for r3426 for bug 134466 and add warnings to docs.
svn path=/main/trunk/; revision=3437
-rwxr-xr-xbin/emerge6
-rw-r--r--man/emerge.14
-rw-r--r--pym/emergehelp.py6
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"