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