From 8eea7af6e063690792333637fb54a1c876d5e7c5 Mon Sep 17 00:00:00 2001 From: bapt Date: Sat, 20 Jun 2015 00:13:28 +0000 Subject: 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 --- share/doc/usd/13.viref/Makefile | 11 +++++++---- share/doc/usd/13.viref/merge.awk | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 share/doc/usd/13.viref/merge.awk (limited to 'share/doc/usd') 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" +} -- cgit v1.1