there are scenarios where running emerge --ask in a script is desirable. (mine is an automated/minimal-intervention emerge-world script where I want to log --pretend output, on a slower box where a separate --pretend step would be a nontrivial increase in system usage.) it is also unclear what benefit this limitation brings. for the benefit of emerge's flexibility as a unix utility, and its code clarity and minimalism, this check should be removed. Reproducible: Always Steps to Reproduce: 1. run: #!/bin/bash nice -n40 ( echo '~/BIN/EW RUNNING EMERGE WORLD AT'; date; yes | emerge -autvgDN world ) | tee -a ~/log/u Actual Results: ~/BIN/EW RUNNING EMERGE WORLD AT Sun Nov 25 22:10:28 PST 2007 !!! "--ask" should only be used in a terminal. Exiting. Expected Results: ~/BIN/EW RUNNING EMERGE WORLD AT Sun Nov 25 23:08:58 PST 2007 These are the packages that would be merged, in reverse order: Calculating world dependencies ... a patch against /usr/bin/emerge of sys-apps/portage-2.1.4_rc3 6393,6399d6392 < # forbid --ask when not in a terminal < # note: this breaks `emerge --ask | tee logfile`, but that doesn't work anyway. < if ("--ask" in myopts) and (not sys.stdin.isatty()): < portage.writemsg("!!! \"--ask\" should only be used in a terminal. Exiting.\n", < noiselevel=-1) < sys.exit(1) <
And what exactly is the point of this? You can run emerge with -v and it will output a deptree before building. Doing 'yes | emerge --ask' is just silly.
it is not that silly when you consider that there are packages like sci-libs/blas-atlas that needlessly pretend to require interactive configuration to compile although the -v solution also addresses some of my issues, the isatty check is still paternalistic, un-unixlike, and unnecessary while offering no safety. i for one will continue to auto-patch it out on upgrades i would at least clean up the comment there good luck
(In reply to comment #2) > although the -v solution also addresses some of my issues, the isatty check is > still paternalistic, un-unixlike, and unnecessary while offering no safety. i > for one will continue to auto-patch it out on upgrades Isn't it a reasonable assumption that something unintended has happened when --ask is not accompanied by a tty? If we're not going to exit, wouldn't it be safer to drop to --pretend mode? I'd prefer not to encourage or have to support the abuse of options in ways that they are not intended to work. Is there something about the -v option that makes it unsuitable for your needs?