2 ##############################################################################
3 # Copyright (c) 2004-2011,2012 Free Software Foundation, Inc. #
5 # Permission is hereby granted, free of charge, to any person obtaining a #
6 # copy of this software and associated documentation files (the "Software"), #
7 # to deal in the Software without restriction, including without limitation #
8 # the rights to use, copy, modify, merge, publish, distribute, distribute #
9 # with modifications, sublicense, and/or sell copies of the Software, and to #
10 # permit persons to whom the Software is furnished to do so, subject to the #
11 # following conditions: #
13 # The above copyright notice and this permission notice shall be included in #
14 # all copies or substantial portions of the Software. #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
19 # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
21 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
22 # DEALINGS IN THE SOFTWARE. #
24 # Except as contained in this notice, the name(s) of the above copyright #
25 # holders shall not be used in advertising or otherwise to promote the sale, #
26 # use or other dealings in this Software without prior written #
28 ##############################################################################
30 # Author: Thomas E. Dickey
32 # $Id: gen_edit.sh,v 1.5 2012/04/01 15:04:37 tom Exp $
33 # Generate a sed-script for converting the terminfo.src to the form which will
37 # The leaf directory names (lib, tabset, terminfo)
42 : ${datadir=/usr/share}
43 : ${WHICH_LINUX=$linux_dft}
44 : ${WHICH_XTERM=xterm-new}
47 # If we're not installing into /usr/share/, we'll have to adjust the location
48 # of the tabset files in terminfo.src (which are in a parallel directory).
49 TABSET
=${datadir}/tabset
50 if test "x$TABSET" != "x/usr/share/tabset" ; then
52 s%/usr/share/tabset%$TABSET%g
56 if test "$WHICH_XTERM" != "xterm-new" ; then
57 echo "** using $WHICH_XTERM terminal description for XTerm entry" >&2
59 /^# This is xterm for ncurses/,/^$/{
60 s/use=xterm-new,/use=$WHICH_XTERM,/
65 if test "$XTERM_KBS" != "BS" ; then
66 echo "** using DEL for XTerm backspace-key" >&2
68 /^xterm+kbs|fragment for backspace key/,/^#/{
74 # Work around incompatibities built into Linux console. The 2.6 series added
75 # a patch to fixup the SI/SO behavior, which is closer to vt100, but the older
76 # kernels do not recognize those controls. All of the kernels recognize the
77 # older flavor of rmacs/smacs, but beginning in the late 1990s, changes made
78 # as part of implementing UTF-8 prevent using those for line-drawing when the
79 # console is in UTF-8 mode. Taking into account the fact that it took about
80 # ten years to provide (and distribute) the 2.6 series' change for SI/SO, the
81 # default remains "linux2.2".
82 case x
$WHICH_LINUX in #(vi
84 system
=`uname -s 2>/dev/null`
85 if test "x$system" = xLinux
99 WHICH_LINUX
=$linux_dft
103 # allow specific setting
106 WHICH_LINUX
=$linux_dft
110 if test $WHICH_LINUX != $linux_dft
112 echo "** using $WHICH_LINUX terminal description for Linux console" >&2
114 /^# This is Linux console for ncurses/,/^$/{
115 s/use=$linux_dft,/use=$WHICH_LINUX,/