summaryrefslogtreecommitdiffstats
path: root/share/doc/usd
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-06-20 00:13:28 +0000
committerbapt <bapt@FreeBSD.org>2015-06-20 00:13:28 +0000
commit8eea7af6e063690792333637fb54a1c876d5e7c5 (patch)
tree9b4584758a814b5c7747ebe2627fcd223809c46e /share/doc/usd
parent375cc5cb13a6d529655fac3fe8e03d73a3cea238 (diff)
downloadFreeBSD-src-8eea7af6e063690792333637fb54a1c876d5e7c5.zip
FreeBSD-src-8eea7af6e063690792333637fb54a1c876d5e7c5.tar.gz
Readd merge.awk forgotten while importing the old vi documentation directly into
the tree. Do not rely on SRCDIR to find the merge.awk script but use .CURDIR Fix a long standing bug making the generated documents never including the index
Diffstat (limited to 'share/doc/usd')
-rw-r--r--share/doc/usd/13.viref/Makefile11
-rw-r--r--share/doc/usd/13.viref/merge.awk17
2 files changed, 24 insertions, 4 deletions
diff --git a/share/doc/usd/13.viref/Makefile b/share/doc/usd/13.viref/Makefile
index 49226ba..a60e326 100644
--- a/share/doc/usd/13.viref/Makefile
+++ b/share/doc/usd/13.viref/Makefile
@@ -2,7 +2,6 @@
# $FreeBSD$
VOLUME= usd/13.viref
-SRCS= vi.ref-patched
EXTRA= ex.cmd.roff ref.so set.opt.roff vi.cmd.roff
MACROS= -me
CLEANFILES= vi.ref-patched index
@@ -15,18 +14,22 @@ vi.ref-patched: vi.ref
PRINTERDEVICE?= ascii
.for _dev in ${PRINTERDEVICE}
+SRCS+= vi.ref-${_dev}
EXTRA+= index.so.${_dev}
-CLEANFILES+= index.so.${_dev}
+CLEANFILES+= index.so.${_dev} vi.ref-${_dev}
+
+vi.ref-${_dev}: index.so.${_dev}
+ sed -e 's:^\.so index\.so\.\\\*\[\.T\]$$:${_dev}:' vi.ref-patched > ${.TARGET}
# Build index.so as a side-effect of building the paper.
-index.so.${_dev}: ${SRCS} ${EXTRA:Nindex.so.${_dev}}
+index.so.${_dev}: vi.ref-patched ${EXTRA:Nindex.so.${_dev}}
sed -e 's:^\.so index\.so\.\\\*\[\.T\]$$::' vi.ref-patched | \
${ROFF.${_dev}} -U -z
sed -e 's/MINUSSIGN/-/' \
-e 's/DOUBLEQUOTE/""/' \
-e "s/SQUOTE/'/" \
-e 's/ /__SPACE/g' < index | \
- sort -u '-t ' -k 1,1 -k 2n | awk -f ${SRCDIR}/merge.awk | \
+ sort -u '-t ' -k 1,1 -k 2n | awk -f ${.CURDIR}/merge.awk | \
sed -e 's/__SPACE/ /g' \
-e "s/^\\(['\\.]\\)/\\\\\&\\1/" > ${.TARGET}
.endfor
diff --git a/share/doc/usd/13.viref/merge.awk b/share/doc/usd/13.viref/merge.awk
new file mode 100644
index 0000000..e85f7d3
--- /dev/null
+++ b/share/doc/usd/13.viref/merge.awk
@@ -0,0 +1,17 @@
+# $FreeBSD$
+# @(#)merge.awk 8.3 (Berkeley) 5/25/94
+#
+# merge index entries into one line per label
+$1 == prev {
+ printf ", %s", $2;
+ next;
+}
+{
+ if (NR != 1)
+ printf "\n";
+ printf "%s \t%s", $1, $2;
+ prev = $1;
+}
+END {
+ printf "\n"
+}
OpenPOWER on IntegriCloud