Gentoo Archives: gentoo-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] New PROPERTIES=interactive value to identify interactive packages?
Date: Thu, 07 Aug 2008 05:34:40
Message-Id: 489A896D.1030809@gentoo.org
In Reply to: Re: [gentoo-dev] [RFC] New PROPERTIES=interactive value to identify interactive packages? by Jeremy Olexa
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA1
3
4 Jeremy Olexa wrote:
5 >> Please consider a new PROPERTIES=interactive setting that allows an
6 >> ebuild to indicate that it uses stdin and stdout for user
7 >
8 > I don't think anyone will disagree with this one. The one problem that I
9 > see is that if the ebuild still doesn't have this value in it, portage
10 > will *look* like it has hung itself out to dry. I have no idea if this
11 > is easy to fix or not. If it is easy, then I still would like to propose
12 > that it gets sent to the foreground when in background mode.
13
14 We can use standard job control functions such as tcsetpgrp() to put
15 processes in the background and then detect when they're sent a
16 SIGTTIN signal in order to know that they've attempted to read from
17 stdin.
18
19 However, it's still useful to have PROPERTIES=interactive as a means
20 have knowledge of this behavior in advance, in case the user would
21 like to mask such ebuilds.
22
23 It also simplifies implementation details a bit if the package
24 manager can just grant exclusive stdio access in advance rather than
25 having to detect it when it happens and then having to update the
26 display from a saved output buffer or telling the application to
27 redraw itself (like dtach [1] does with Ctrl+L code) or whatnot.
28
29 > What will
30 > portage's behavior be when the user asks to be in background mode and
31 > there is an ebuild in the depgraph that has PROPERTIES=interactive?
32
33 I was planning to add some option for masking those, like
34 - --exclude-property=interactive or something like that. That would
35 mask the package so that it wouldn't be be included in the depgraph
36 unless it happens to be installed already.
37
38 > If
39 > it bails out, then the problem described above is moot (only if
40 > maintainers are diligent).
41
42 Like Alec said, I don't think this is a difficult thing to get right
43 and even if the maintainer doesn't get it right initially then it's
44 not something that's very difficult to spot and fix. More elusive
45 bugs certainly do exist. That said, I still would like to make use
46 of the standard job control functions to detect and handle cases
47 like that. However, that does not entirely preclude the usefulness
48 of the knowledge that PROPERTIES=interactive is intended to provide.
49
50 > -Jeremy
51 >
52 >
53
54 [1]
55 http://www.opengroup.org/onlinepubs/009695399/functions/tcsetpgrp.html
56 [2] http://dtach.sourceforge.net/
57 -----BEGIN PGP SIGNATURE-----
58 Version: GnuPG v2.0.9 (GNU/Linux)
59
60 iEYEARECAAYFAkiaiWwACgkQ/ejvha5XGaMTMQCfS9IoGqHN8ehDpekir2VSO1+7
61 ELkAn1NJp7HJIQKu0hkC+CVXd7pwWF8c
62 =PQwl
63 -----END PGP SIGNATURE-----

Replies