summaryrefslogtreecommitdiffstats
path: root/share/mk/bsd.port.subdir.mk
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>1997-11-06 02:20:27 +0000
committerfenner <fenner@FreeBSD.org>1997-11-06 02:20:27 +0000
commit8f1f01f232d4a7b7f8227c0b6bef21f04471b868 (patch)
treed9d7190d935659288284f3d3523212d56da67f59 /share/mk/bsd.port.subdir.mk
parentd8926c95c3be457db98d447aac09cafab896739a (diff)
downloadFreeBSD-src-8f1f01f232d4a7b7f8227c0b6bef21f04471b868.zip
FreeBSD-src-8f1f01f232d4a7b7f8227c0b6bef21f04471b868.tar.gz
Convert <, > and & into &lt;, &gt; and &amp; in port names, COMMENT and
DESCR files when building README.html . Don't use control characters in sed statement. Problems reported by "Chris G. Demetriou" <cgd@pa.dec.com> in NetBSD PR pkg/4341.
Diffstat (limited to 'share/mk/bsd.port.subdir.mk')
-rw-r--r--share/mk/bsd.port.subdir.mk21
1 files changed, 14 insertions, 7 deletions
diff --git a/share/mk/bsd.port.subdir.mk b/share/mk/bsd.port.subdir.mk
index f580c05..f494c45 100644
--- a/share/mk/bsd.port.subdir.mk
+++ b/share/mk/bsd.port.subdir.mk
@@ -1,5 +1,5 @@
# from: @(#)bsd.subdir.mk 5.9 (Berkeley) 2/1/91
-# $Id: bsd.port.subdir.mk,v 1.19 1997/03/09 23:10:56 wosch Exp $
+# $Id: bsd.port.subdir.mk,v 1.20 1997/08/22 11:16:15 asami Exp $
#
# The include file <bsd.port.subdir.mk> contains the default targets
# for building ports subdirectories.
@@ -119,27 +119,34 @@ README= ${TEMPLATES}/README.top
README= ${TEMPLATES}/README.category
.endif
+HTMLIFY= sed -e 's/&/\&amp;/g' -e 's/>/\&gt;/g' -e 's/</\&lt;/g'
+
README.html:
@echo "===> Creating README.html"
@> $@.tmp
.for entry in ${SUBDIR}
.if defined(PORTSTOP)
- @echo -n '<a href="'${entry}/README.html'">${entry}</a>: ' >> $@.tmp
+ @echo -n '<a href="'${entry}/README.html'">'"`echo ${entry} | ${HTMLIFY}`"'</a>: ' >> $@.tmp
.else
- @echo -n '<a href="'${entry}/README.html'">'"`cd ${entry}; make package-name`</a>: " >> $@.tmp
+ @echo -n '<a href="'${entry}/README.html'">'"`cd ${entry}; make package-name | ${HTMLIFY}`</a>: " >> $@.tmp
.endif
.if exists(${entry}/pkg/COMMENT)
- @cat ${entry}/pkg/COMMENT >> $@.tmp
+ @${HTMLIFY} ${entry}/pkg/COMMENT >> $@.tmp
.else
@echo "(no description)" >> $@.tmp
.endif
.endfor
@sort -t '>' +1 -2 $@.tmp > $@.tmp2
+.if exists(${.CURDIR}/pkg/DESCR)
+ @${HTMLIFY} ${.CURDIR}/pkg/DESCR > $@.tmp3
+.else
+ @> $@.tmp3
+.endif
@cat ${README} | \
- sed -e 's%%CATEGORY%%'`echo ${.CURDIR} | sed -e 's.*/\([^/]*\)$$\1'`'g' \
- -e '/%%DESCR%%/r${.CURDIR}/pkg/DESCR' \
+ sed -e 's/%%CATEGORY%%/'"`basename ${.CURDIR}`"'/g' \
+ -e '/%%DESCR%%/r$@.tmp3' \
-e '/%%DESCR%%/d' \
-e '/%%SUBDIR%%/r$@.tmp2' \
-e '/%%SUBDIR%%/d' \
> $@
- @rm -f $@.tmp $@.tmp2
+ @rm -f $@.tmp $@.tmp2 $@.tmp3
OpenPOWER on IntegriCloud