-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jeremy Olexa wrote: >> Please consider a new PROPERTIES=interactive setting that allows an >> ebuild to indicate that it uses stdin and stdout for user > > I don't think anyone will disagree with this one. The one problem that I > see is that if the ebuild still doesn't have this value in it, portage > will *look* like it has hung itself out to dry. I have no idea if this > is easy to fix or not. If it is easy, then I still would like to propose > that it gets sent to the foreground when in background mode.
We can use standard job control functions such as tcsetpgrp() to put processes in the background and then detect when they're sent a SIGTTIN signal in order to know that they've attempted to read from stdin. However, it's still useful to have PROPERTIES=interactive as a means have knowledge of this behavior in advance, in case the user would like to mask such ebuilds. It also simplifies implementation details a bit if the package manager can just grant exclusive stdio access in advance rather than having to detect it when it happens and then having to update the display from a saved output buffer or telling the application to redraw itself (like dtach [1] does with Ctrl+L code) or whatnot. > What will > portage's behavior be when the user asks to be in background mode and > there is an ebuild in the depgraph that has PROPERTIES=interactive? I was planning to add some option for masking those, like - --exclude-property=interactive or something like that. That would mask the package so that it wouldn't be be included in the depgraph unless it happens to be installed already. > If > it bails out, then the problem described above is moot (only if > maintainers are diligent). Like Alec said, I don't think this is a difficult thing to get right and even if the maintainer doesn't get it right initially then it's not something that's very difficult to spot and fix. More elusive bugs certainly do exist. That said, I still would like to make use of the standard job control functions to detect and handle cases like that. However, that does not entirely preclude the usefulness of the knowledge that PROPERTIES=interactive is intended to provide. > -Jeremy > > [1] http://www.opengroup.org/onlinepubs/009695399/functions/tcsetpgrp.html [2] http://dtach.sourceforge.net/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkiaiWwACgkQ/ejvha5XGaMTMQCfS9IoGqHN8ehDpekir2VSO1+7 ELkAn1NJp7HJIQKu0hkC+CVXd7pwWF8c =PQwl -----END PGP SIGNATURE-----