From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-683185-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 25B831393EA
	for <garchives@archives.gentoo.org>; Wed,  2 Apr 2014 20:09:29 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id E74A2E0DCF;
	Wed,  2 Apr 2014 20:09:25 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 58EF1E0DC8
	for <gentoo-commits@lists.gentoo.org>; Wed,  2 Apr 2014 20:09:25 +0000 (UTC)
Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 687F333FDDB
	for <gentoo-commits@lists.gentoo.org>; Wed,  2 Apr 2014 20:09:24 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by spoonbill.gentoo.org (Postfix) with ESMTP id 349D6188F4
	for <gentoo-commits@lists.gentoo.org>; Wed,  2 Apr 2014 20:09:23 +0000 (UTC)
From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" <brian.dolbec@gmail.com>
Message-ID: <1396469062.c7539118560247bbc182cd8c9602d323533a23a6.dol-sen@gentoo>
Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/targets/
X-VCS-Repository: proj/catalyst
X-VCS-Files: catalyst/targets/generic_target.py
X-VCS-Directories: catalyst/targets/
X-VCS-Committer: dol-sen
X-VCS-Committer-Name: Brian Dolbec
X-VCS-Revision: c7539118560247bbc182cd8c9602d323533a23a6
X-VCS-Branch: master
Date: Wed,  2 Apr 2014 20:09:23 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 8e9cc2c4-7dd3-427e-bee1-fd6f4e06a158
X-Archives-Hash: 695d132b5a31241e9ab01a8e99577f63
Message-ID: <20140402200923.FjyvU0b3dQoyDgU6AfNRJJ5PnwrN3j8T__FH6OTtzmw@z>

commit:     c7539118560247bbc182cd8c9602d323533a23a6
Author:     W. Trevor King <wking <AT> tremily <DOT> us>
AuthorDate: Fri Dec 27 02:40:10 2013 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Apr  2 20:04:22 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=c7539118

catalyst/targets/generic_target.py: Pass TERM through to the chroot

Avoid:

  Running stage1-chroot.sh in chroot /var/tmp/catalyst/tmp/default/...
  tput: No value for $TERM and no -T specified

by passing the caller's TERM environment variable [1] through to the
chroot.  If the caller does not supply TERM, default to 'dumb' which
disables color etc., but should be the most portable.  On Gentoo, the
dumb terminfo (/usr/share/terminfo/d/dumb) is distributed as part of
ncurses [2].  You can list supported terminals with toe, which is also
distributed with ncurses [2]:

  $ toe
  ansi            ansi/pc-term compatible with color
  dumb            80-column dumb tty
  linux           linux console
  ...

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_03
[2]: http://www.gnu.org/software/ncurses/

---
 catalyst/targets/generic_target.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/catalyst/targets/generic_target.py b/catalyst/targets/generic_target.py
index de51994..382f1c7 100644
--- a/catalyst/targets/generic_target.py
+++ b/catalyst/targets/generic_target.py
@@ -1,3 +1,5 @@
+import os
+
 from catalyst.support import *
 
 class generic_target:
@@ -7,5 +9,7 @@ class generic_target:
 	def __init__(self,myspec,addlargs):
 		addl_arg_parse(myspec,addlargs,self.required_values,self.valid_values)
 		self.settings=myspec
-		self.env={}
-		self.env["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin"
+		self.env = {
+			'PATH': '/bin:/sbin:/usr/bin:/usr/sbin',
+			'TERM': os.getenv('TERM', 'dumb'),
+			}