Eu faço isso com este script (no Debian, por exemplo, que pressupõe que kbs
é ^?
), para testar compilações locais de ncurses:
#!/bin/sh
# $Id: test-terminfo+,v 1.10 2012/04/21 15:52:17 tom Exp $
# vi:sw=4 ts=4
# Compile the given terminfo source-file(s) into a temporary directory, compare
# the compiled files against the system version.
if test $# = 0 ; then
with-local-ncurses $0 terminfo terminfo.src
else
OPTS=-x
MY_NCURSES=/usr/local/ncurses
MY_TERMINFO=$MY_NCURSES/share/terminfo
PATH=$MY_NCURSES/bin:$PATH; export PATH
unset TERMINFO_DIRS
unset TERMINFO
TMP=/tmp/term$$
rm -rf $TMP
trap "rm -rf $TMP" 0 1 2 3 15
mkdir $TMP
rm -f $TMP/terminfo.sed
cat >$TMP/terminfo.sed <<EOF
s,/usr/share,$MY_NCURSES/share,g
/^xterm+kbs|fragment for backspace key, kbs=/s/kbs=^H,/kbs=^?,/
/^xterm+kbs|fragment for backspace key,\$/,/^#/{
s/kbs=^H,/kbs=^?,/
}
EOF
for name in $*
do
if test -f "$name" ; then
sed -f $TMP/terminfo.sed $name >$TMP/source
TERMINFO=$TMP tic -U $OPTS -R ALL $TMP/source
fi
done
TERMINFO=$MY_TERMINFO
for name in $TMP/?/*
do
base='dirname $name'
base='basename $base'
name='basename $name'
case $name in
??) # ignore 2-char termcap names
;;
*)
if test -f "$TERMINFO/$base/$name" ; then
infocmp -U $OPTS -q -p -f -A $TERMINFO -B $TMP $name $name
else
echo missing "$name $base"
fi
;;
esac
done
fi
O log informa por que alguns dos detalhes são importantes:
----------------------------
revision 1.10
date: 2012/04/21 15:52:17; author: tom; state: Exp; lines: +2 -3
add -x
----------------------------
revision 1.9
date: 2012/04/14 21:50:23; author: tom; state: Exp; lines: +7 -4
tweak to handle output from terminfo-uses script
----------------------------
revision 1.8
date: 2012/03/17 19:31:02; author: tom; state: Exp; lines: +15 -4
tweaks to make this compare more closely to what I've installed, by
accounting for the pathnames used in cfg-local
----------------------------
revision 1.7
date: 2011/08/10 08:49:23; author: tom; state: Exp; lines: +2 -2
make this work with Solaris
----------------------------
revision 1.6
date: 2011/06/11 17:23:15; author: tom; state: Exp; lines: +2 -2
remove spurious "eval" when doing no-args
----------------------------
revision 1.5
date: 2004/07/05 14:06:46; author: tom; state: Exp; lines: +15 -7
use -U option to simplify comparing termcap
ignore 2-char termcap names
----------------------------
revision 1.4
date: 2004/01/31 17:42:01; author: tom; state: Exp; lines: +2 -2
ignore padding
----------------------------
revision 1.3
date: 2003/05/31 21:00:37; author: tom; state: Exp; lines: +9 -5
use local-ncurses rather than installed version
----------------------------
revision 1.2
date: 2002/06/22 22:31:53; author: tom; state: Exp; lines: +1 -1
add -p option
----------------------------
revision 1.1
date: 2001/05/19 20:07:23; author: tom; state: Exp
Eu procuro por diferenças (além das entradas ) procurando por caracteres .
Por que o nome é test-terminfo
+ , porque o script original (escrito em 1998) foi comparado apenas com o terminfo do sistema (não havia nenhum pacote para evitar contaminação .. .).
Como de costume, ajuda a ler as páginas de manual:
-
tic
- o compilador de entrada-descrição do terminfo
-
infocmp
- compare ou imprima descrições de terminfo