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
This commit is contained in:
parent
d0ecc14d49
commit
d586a8e4ae
@ -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
|
||||
|
17
share/doc/usd/13.viref/merge.awk
Normal file
17
share/doc/usd/13.viref/merge.awk
Normal file
@ -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"
|
||||
}
|
Loading…
Reference in New Issue
Block a user