X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Fcapconvert;h=25c5c45c01ed89a07cbaefcae6411fbb89115490;hp=2125a0d68d0282a93214a05a057c9297ec2cc59f;hb=0de8912c1c0746eb37b733e9e6fdf852aab9506a;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1;ds=sidebyside diff --git a/progs/capconvert b/progs/capconvert index 2125a0d6..25c5c45c 100755 --- a/progs/capconvert +++ b/progs/capconvert @@ -1,5 +1,32 @@ #!/bin/sh -# $Id: capconvert,v 1.3 1997/08/02 21:52:06 tom Exp $ +############################################################################## +# Copyright (c) 1998-2017,2019 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"), # +# to deal in the Software without restriction, including without limitation # +# the rights to use, copy, modify, merge, publish, distribute, distribute # +# with modifications, sublicense, and/or sell copies of the Software, and to # +# permit persons to whom the Software is furnished to do so, subject to the # +# following conditions: # +# # +# The above copyright notice and this permission notice shall be included in # +# all copies or substantial portions of the Software. # +# # +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # +# DEALINGS IN THE SOFTWARE. # +# # +# Except as contained in this notice, the name(s) of the above copyright # +# holders shall not be used in advertising or otherwise to promote the sale, # +# use or other dealings in this Software without prior written # +# authorization. # +############################################################################## +# $Id: capconvert,v 1.7 2019/03/02 22:51:42 tom Exp $ # # capconvert -- automated conversion from termcap to terminfo # @@ -50,16 +77,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 @@ -82,7 +111,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 @@ -114,7 +143,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; @@ -176,18 +205,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" @@ -208,7 +237,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."