X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Fcapconvert;h=bcd56d3dc42a8c5d93f1ff8a8f68bff9c7a36216;hp=8199bbf09b7efc2292e9f78ffe8f1d81eb06c08b;hb=89730563d0a660d4ddd83d28660dc23c6d3f0bed;hpb=027ae42953e3186daed8f3882da73de48291b606 diff --git a/progs/capconvert b/progs/capconvert index 8199bbf0..bcd56d3d 100755 --- a/progs/capconvert +++ b/progs/capconvert @@ -1,6 +1,7 @@ #!/bin/sh ############################################################################## -# Copyright (c) 1998,2006 Free Software Foundation, Inc. # +# Copyright 2019,2020 Thomas E. Dickey # +# Copyright 1998-2011,2017 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -26,7 +27,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: capconvert,v 1.4 2006/04/22 21:46:17 tom Exp $ +# $Id: capconvert,v 1.9 2020/02/02 23:34:34 tom Exp $ # # capconvert -- automated conversion from termcap to terminfo # @@ -77,16 +78,18 @@ then # Assumes the terminfo master covers all canned terminal types exit; fi - if test "$TERM" = "xterm" - then + case $TERM in + xterm | xterm-*) echo "You are running xterm, which usually sets TERMCAP itself." echo "We can ignore this, because terminfo knows about xterm." echo "So you will just use the system-wide terminfo tree." - exit; - else + exit + ;; + *) echo "We will have to make a local one for you anyway, to capture the effect" echo "of your TERMCAP variable." - fi + ;; + esac else echo "No system-wide terminfo tree. We will make you a local one." fi @@ -109,7 +112,7 @@ IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for x in $PATH . do if test $OPT $x/tic - then + then TIC=$x/tic break fi @@ -141,7 +144,7 @@ if test -d $HOME/.terminfo then echo "It appears you already have a private terminfo directory" echo "at $HOME/.terminfo; this seems odd, because TERMINFO" - echo "is not defined. I am not going to second-guess this -- if you" + echo "is not defined. I am not going to second-guess this -- if you" echo "really want me to try auto-configuring for you, remove or" echo "rename $HOME/terminfo and run me again." exit; @@ -177,7 +180,7 @@ else echo "I am going to assume this is the terminfo source included with" echo "the ncurses distribution. If this assumption is wrong, please" echo "interrupt me now! OK to continue?" - read ans; + read answer; ;; 2) echo "I see more than one possible terminfo source. Here they are:" @@ -203,18 +206,18 @@ echo "OK, now I will make your private terminfo tree. This may take a bit..." # # Kluge alert: we compile terminfo.src in two pieces because a lot of machines # with < 16MB RAM choke on tic's core-hog habits. -trap "rm -f tsplit$$.*" 0 1 2 5 15 +trap "rm -f tsplit$$.*" EXIT INT QUIT TERM HUP sed -n $master \ -e '1,/SPLIT HERE/w 'tsplit$$.01 \ -e '/SPLIT HERE/,$w 'tsplit$$.02 \ 2>/dev/null for x in tsplit$$.*; do eval $TIC $x; done rm tsplit$$.* -trap 0 1 2 5 15 +trap EXIT INT QUIT TERM HUP # echo "You now have a private tree under $HOME/.terminfo;" echo "the ncurses library will automatically read from it," -echo "and ncurses tic will automatically compile entries to it." +echo "and ncurses tic will automatically compile entries to it." # We're done unless user has a .termcap file or equivalent named by TERMCAP if test -z "$TERMCAP" @@ -235,7 +238,7 @@ then echo "Done." echo "Note that editing $HOME/.termcap will no longer change the data curses sees." elif test -f "$TERMCAP" -then +then echo "Your TERMCAP names the file $TERMCAP. I will compile that." eval $TIC $TERMCAP echo "Done." @@ -249,7 +252,7 @@ else echo "Done." echo "Note that editing TERMCAP will no longer change the data curses sees." fi -echo "To do that, decompile the terminal decription you want with infocmp(1)," +echo "To do that, decompile the terminal description you want with infocmp(1)," echo "edit to taste, and recompile using tic(1)." # capconvert ends here