Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 49855 - emerge --ask does not handle end of file
Summary: emerge --ask does not handle end of file
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Interface (emerge) (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2004-05-03 09:10 UTC by Benjamin Braatz
Modified: 2004-10-22 08:48 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Braatz 2004-05-03 09:10:06 UTC
When emerging with the "--ask" option, emerge crashes with a traceback, if an end of file character is given to the question, because raw_input does not seem to handle the EOF.

Reproducible: Always
Steps to Reproduce:
1. emerge --ask some_ebuild
2. Give ^D (End of File) to the question

Actual Results:  
emerge crashed with the following output.

Do you want me to merge these packages? [Yes/No] Traceback (most recent call last):
  File "/usr/bin/emerge", line 2566, in ?
    if userquery(prompt)=="No":
  File "/usr/bin/emerge", line 49, in userquery
    response=raw_input("["+string.join([colours[i](responses[i]) for i in
range(len(responses))],"/")+"] ")
EOFError

Expected Results:  
I don't know:

Taking into account that the EOF will most often not be caused by the user
intentionally, but may more likely come from some wrapper script not able to
handle interactive emerges, one should perhaps choose to do less harm and treat
EOF as No.

On the other hand, Return is treated as Yes, so it would seem analogous to treat
EOF as Yes.

This behaviour was already described in <a
href="http://bugs.gentoo.org/show_bug.cgi?id=41293#c1">Bug 41293</a>, but was
considered not to be severe enough, and so that bug was marked resolved.

I ran into this traceback, when trying to "revdep-rebuild --ask", which does not
work, because of <a href="http://bugs.gentoo.org/show_bug.cgi?id=37485">Bug
37485</a>.

I think, it seems quite likely, that other scripts in the future ("official"
ones in portage and user-created) will also call emerge without considering
possible interaction and, hence, will perhaps run into the same error.

So, it seems worth fixing IMO.
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2004-05-20 10:29:12 UTC
This is handled in 2.0.51
Comment 2 Nicholas Jones (RETIRED) gentoo-dev 2004-10-22 08:48:02 UTC
Bug has been fixed and released in stable portages on or before 2.0.51-r2