Generate tabset files using a script. ok deraadt millert
authornicm <nicm@openbsd.org>
Fri, 23 Aug 2024 15:13:58 +0000 (15:13 +0000)
committernicm <nicm@openbsd.org>
Fri, 23 Aug 2024 15:13:58 +0000 (15:13 +0000)
share/tabset/Makefile
share/tabset/gentabset.sh [new file with mode: 0644]
share/tabset/std [deleted file]
share/tabset/stdcrt [deleted file]
share/tabset/vt100 [deleted file]
share/tabset/vt300 [deleted file]

index c90b235..687f954 100644 (file)
@@ -1,12 +1,15 @@
-#      $OpenBSD: Makefile,v 1.5 2019/12/21 21:40:01 espie Exp $
+#      $OpenBSD: Makefile,v 1.6 2024/08/23 15:13:58 nicm Exp $
 #      from: @(#)Makefile      5.3 (Berkeley) 10/22/90
 
 FILES= std stdcrt vt100 vt300
-NOOBJ= noobj
+CLEANFILES+= ${FILES}
 
-all clean cleandir tags:
+all: ${FILES}
 
-realinstall:
+${FILES}:
+       sh ${.CURDIR}/gentabset.sh ${.CURDIR}/obj
+
+realinstall: ${FILES}
        install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FILES} \
            ${DESTDIR}${BINDIR}/tabset
 
diff --git a/share/tabset/gentabset.sh b/share/tabset/gentabset.sh
new file mode 100644 (file)
index 0000000..da8d1fd
--- /dev/null
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+DESTDIR=$1
+
+#
+# Write out tabset file: arguments are prefix, number of tab stops,
+# tab stop sequence, postfix.
+#
+write_tabset() {
+       printf "$1"
+       for i in $(seq $2); do printf "$3"; done
+       printf "$4"
+}
+
+# Tabset files for HP terminals.
+write_tabset '\r\e3\r' 13 '        \e1' '\n' >$DESTDIR/std
+write_tabset '\r\e3\r' 9 '        \e1' '' >$DESTDIR/stdcrt
+
+# Tabset for VT100 and derivatives.
+write_tabset '\r\n\e[3g\n' 15 '\eH        ' '\eH\n' >$DESTDIR/vt100
+
+# Tabset for VT3xx and VT4xx and derivatives.
+printf '\n\e[3g\n\eP2$t9/17/25/33/41/49/57/65/73/81/89/97/105/113/121/129\e\\\n' >$DESTDIR/vt300
+
+exit 0
diff --git a/share/tabset/std b/share/tabset/std
deleted file mode 100644 (file)
index e93f737..0000000
+++ /dev/null
@@ -1 +0,0 @@
-\r\e3\r        \e1        \e1        \e1        \e1        \e1        \e1        \e1        \e1        \e1        \e1        \e1        \e1        \e1
diff --git a/share/tabset/stdcrt b/share/tabset/stdcrt
deleted file mode 100644 (file)
index 66ba12f..0000000
+++ /dev/null
@@ -1 +0,0 @@
-\r\e3\r        \e1        \e1        \e1        \e1        \e1        \e1        \e1        \e1        \e1\r
\ No newline at end of file
diff --git a/share/tabset/vt100 b/share/tabset/vt100
deleted file mode 100644 (file)
index 8828d19..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-\r
-\e[3g
-\eH        \eH        \eH        \eH        \eH        \eH        \eH        \eH        \eH        \eH        \eH        \eH        \eH        \eH        \eH        \eH
diff --git a/share/tabset/vt300 b/share/tabset/vt300
deleted file mode 100644 (file)
index b1f9ce1..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-
-\e[3g
-\eP2$t9/17/25/33/41/49/57/65/73/81/89/97/105/113/121/129\e\