Gentoo Archives: gentoo-catalyst

From: "W. Trevor King" <wking@×××××××.us>
To: Catalyst <gentoo-catalyst@l.g.o>
Cc: "W. Trevor King" <wking@×××××××.us>
Subject: [gentoo-catalyst] [PATCH] modules/generic_target.py: Pass TERM through to the chroot environment
Date: Sun, 29 Dec 2013 02:55:45
Message-Id: 739db1331359acd82717c3eed4bced3828ad7e8d.1388285607.git.wking@tremily.us
1 From: "W. Trevor King" <wking@×××××××.us>
2
3 Avoid:
4
5 Running stage1-chroot.sh in chroot /var/tmp/catalyst/tmp/default/...
6 tput: No value for $TERM and no -T specified
7
8 by passing the caller's TERM environment variable [1] through to the
9 chroot. If the caller does not supply TERM, default to 'dumb' which
10 disables color etc., but should be the most portable. On Gentoo, the
11 dumb terminfo (/usr/share/terminfo/d/dumb) is distributed as part of
12 ncurses [2]. You can list supported terminals with toe, which is also
13 distributed with ncurses [2]:
14
15 $ toe
16 ansi ansi/pc-term compatible with color
17 dumb 80-column dumb tty
18 linux linux console
19 ...
20
21 [1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03
22 [2]: http://www.gnu.org/software/ncurses/
23 ---
24 modules/generic_target.py | 8 ++++++--
25 1 file changed, 6 insertions(+), 2 deletions(-)
26
27 diff --git a/modules/generic_target.py b/modules/generic_target.py
28 index fe96bd7..30dadc8 100644
29 --- a/modules/generic_target.py
30 +++ b/modules/generic_target.py
31 @@ -1,3 +1,5 @@
32 +import os
33 +
34 from catalyst_support import *
35
36 class generic_target:
37 @@ -7,5 +9,7 @@ class generic_target:
38 def __init__(self,myspec,addlargs):
39 addl_arg_parse(myspec,addlargs,self.required_values,self.valid_values)
40 self.settings=myspec
41 - self.env={}
42 - self.env["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin"
43 + self.env = {
44 + 'PATH': '/bin:/sbin:/usr/bin:/usr/sbin',
45 + 'TERM': os.getenv('TERM', 'dumb'),
46 + }
47 --
48 1.8.3.2

Replies