Gentoo Archives: gentoo-catalyst

From: Brian Dolbec <dolsen@g.o>
To: gentoo-catalyst@l.g.o
Subject: [gentoo-catalyst] [PATCH 4/5] catalyst/targets/generic_target.py: Pass TERM through to the chroot
Date: Sun, 02 Mar 2014 23:01:20
Message-Id: 1393801262-13820-4-git-send-email-dolsen@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH 2/5] generic_stage_target.py: Fix an intermittent snapshot_cache_path keyerror by Brian Dolbec
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 catalyst/targets/generic_target.py | 8 ++++++--
25 1 file changed, 6 insertions(+), 2 deletions(-)
26
27 diff --git a/catalyst/targets/generic_target.py b/catalyst/targets/generic_target.py
28 index de51994..382f1c7 100644
29 --- a/catalyst/targets/generic_target.py
30 +++ b/catalyst/targets/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.5.3

Replies