catalyst/targets/generic_target.py: Pass TERM through to the chroot
authorW. Trevor King <wking@tremily.us>
Fri, 27 Dec 2013 02:40:10 +0000 (18:40 -0800)
committerBrian Dolbec <dolsen@gentoo.org>
Wed, 2 Apr 2014 20:04:22 +0000 (13:04 -0700)
commitc7539118560247bbc182cd8c9602d323533a23a6
tree6f280bd79322a5b54a36aee38c2075956e81d317
parente2cf676cffe44e4048113a48a4362b57867d11b6
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