diff options
author | agc <agc> | 1997-11-21 16:01:54 +0000 |
---|---|---|
committer | agc <agc> | 1997-11-21 16:01:54 +0000 |
commit | d0f7d2ee1d46e06a5b5ce114a30f5dc1add506b4 (patch) | |
tree | dbde60dd0e729490c3984d24032372a75913b77e /mk | |
parent | 0a77145c1b7bd601d91c7499c63492535e644ddb (diff) | |
download | pkgsrc-d0f7d2ee1d46e06a5b5ce114a30f5dc1add506b4.tar.gz |
Modification by Bill Fenner which removes the embedded control
characters, and avoids the wrong interpretation of magic HTML
characters in DESCR files or categories.
Forwarded to me by Chris Demetriou, and refers to PR 4341.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.subdir.mk | 21 | ||||
-rw-r--r-- | mk/bsd.port.subdir.mk | 21 |
2 files changed, 28 insertions, 14 deletions
diff --git a/mk/bsd.pkg.subdir.mk b/mk/bsd.pkg.subdir.mk index 14b03abd354..62cc078308f 100644 --- a/mk/bsd.pkg.subdir.mk +++ b/mk/bsd.pkg.subdir.mk @@ -1,6 +1,6 @@ # 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 -# $NetBSD: bsd.pkg.subdir.mk,v 1.3 1997/09/25 19:09:35 thorpej Exp $ +# $NetBSD: bsd.pkg.subdir.mk,v 1.4 1997/11/21 16:01:54 agc Exp $ # # The include file <bsd.port.subdir.mk> contains the default targets # for building ports subdirectories. @@ -120,27 +120,34 @@ README= ${TEMPLATES}/README.top README= ${TEMPLATES}/README.category .endif +HTMLIFY= sed -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</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 diff --git a/mk/bsd.port.subdir.mk b/mk/bsd.port.subdir.mk index f4b017b8c27..a02cf4efef5 100644 --- a/mk/bsd.port.subdir.mk +++ b/mk/bsd.port.subdir.mk @@ -1,6 +1,6 @@ # 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 -# $NetBSD: bsd.port.subdir.mk,v 1.3 1997/09/25 19:09:35 thorpej Exp $ +# $NetBSD: bsd.port.subdir.mk,v 1.4 1997/11/21 16:01:54 agc Exp $ # # The include file <bsd.port.subdir.mk> contains the default targets # for building ports subdirectories. @@ -120,27 +120,34 @@ README= ${TEMPLATES}/README.top README= ${TEMPLATES}/README.category .endif +HTMLIFY= sed -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</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 |