I have "emerge" aliased as "emerge -av". Typing "emerge sync" in bash causes the following error: Do you want to sync your Portage tree with the mirror at rsync://134.68.220.74/gentoo-portage? [Yes/No] Traceback (most recent call last): File "/usr/bin/emerge", line 2435, in ? if userquery("Do you want to sync your Portage tree with the mirror at\n" + blue(dosyncuri) + bold("?"))=="No": File "/usr/bin/emerge", line 110, in userquery response=raw_input("["+string.join([colours[i](responses[i]) for i in range(len(responses))],"/")+"] ") IOError: [Errno 9] Bad file descriptor Reproducible: Always Steps to Reproduce: 1. run "emerge -av sync"
Remove the -a and it works.
I know.. I'm running "/usr/bin/emerge sync" these days to avoid the alias. But this doesn't change my point; Portage appears to die with a bug just because I added a switch it didn't expect. This shouldn't occur. And IMHO, prompting "do want to sync with .. [y/n]" is a legitimate question.
It's supposed to work, IIRC it was working in an earlier version. Attempting to fix it ( malformed raw_input line? ).
I have no clue what this breaks, or why it was there, but someone was closing stdin in the "sync" code in emerge. I commented it out and the sync appeared to go fine, if all goes well I'll submit the patch.
Created attachment 48003 [details, diff] Comments out the section that closes stdin If this closure is necessary ( no clue why you'd need to close stdin I tried typing all manner of crap while rsync was running and I couldn't make it fubar ) it needs to be moved to after --ask is done so userquery can do it's work. For now it's commented out with a pointer to this bug.
The close prevents people from hurting ebuild.sh by letting portage handle control-c. Move it down to the metadata section instead. See 51-r9 or later.
Fixed on or before 2.0.51.22-r1
Looking through the batch of bugs, I'm not sure that some of these are actually fixed in stable. Others, the requirements have possibly changed after the initial fix was committed. If you think this bug has been closed incorrectly, please reopen or ask that it be reopened.