Gentoo Archives: gentoo-commits

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