diff options
author | agc <agc@pkgsrc.org> | 2000-09-28 10:50:43 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 2000-09-28 10:50:43 +0000 |
commit | 821a2385e4dbd787bf213bc98a4194481ad9b7c8 (patch) | |
tree | 01eb8ec595a406217911b94ccefdded485d4410d /mk | |
parent | 9caae45dc25504366195f4daad0d0fa3115c488b (diff) | |
download | pkgsrc-821a2385e4dbd787bf213bc98a4194481ad9b7c8.tar.gz |
Fix the show-vulnerabilities and show-vulnerabilities-html targets to
work properly in the absence of a vulnerability list.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index f9c5eb69688..6e024a5d94e 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.580 2000/09/27 12:50:49 agc Exp $ +# $NetBSD: bsd.pkg.mk,v 1.581 2000/09/28 10:50:43 agc Exp $ # # This file is in the public domain. # @@ -2790,13 +2790,21 @@ SED_HOMEPAGE_EXPR= -e 's|%%HOMEPAGE%%|<p>This package has a home page at < SED_HOMEPAGE_EXPR= -e 's|%%HOMEPAGE%%||' .endif -show-vulnerabilities: ${DISTDIR}/vulnerabilities - @${AWK} '/^${PKGBASE}/ { print $$0 }' ${DISTDIR}/vulnerabilities +show-vulnerabilities: + @if [ -f ${DISTDIR}/vulnerabilities ]; then \ + ${AWK} '/^${PKGBASE}/ { print $$0 }' ${DISTDIR}/vulnerabilities; \ + else \ + ${ECHO} "No vulnerabilities list found."; \ + fi + +show-vulnerabilities-html: + @if [ -f ${DISTDIR}/vulnerabilities ]; then \ + ${AWK} '/^${PKGBASE}/ { gsub("\<", "\\<", $$1); \ + gsub("\>", "\\>", $$1); \ + printf("<STRONG><LI>%s has a %s exploit (see <a href=\"%s\">%s</a> for more details)</STRONG>\n", $$1, $$2, $$3, $$3) }' \ + ${DISTDIR}/vulnerabilities; \ + fi -show-vulnerabilities-html: ${DISTDIR}/vulnerabilities - @${AWK} '/^${PKGBASE}/ { gsub("\<", "\\<", $$1); \ - gsub("\>", "\\>", $$1); \ - printf("<STRONG><LI>%s has a %s exploit (see <a href=\"%s\">%s</a> for more details)</STRONG>\n", $$1, $$2, $$3, $$3) }' ${DISTDIR}/vulnerabilities .PHONY: README.html README.html: .PRECIOUS @@ -2809,7 +2817,7 @@ README.html: .PRECIOUS @[ -s $@.tmp4 ] || ${ECHO} "<TR><TD><I>(no precompiled binaries available)</I>" >> $@.tmp4 @${MAKE} ${MAKEFLAGS} show-vulnerabilities-html >> $@.tmp5 @[ -s $@.tmp5 ] || ${ECHO} "<I>(no vulnerabilities known)</I>" >> $@.tmp5 - @${LS} -l ${DISTDIR}/vulnerabilities | ${AWK} 'NF > 7 { printf("at %s %s %s\n", $$6, $$7, $$8) }' >> $@.tmp6 + @${LS} -l ${DISTDIR}/vulnerabilities 2>&1 | ${AWK} 'NF > 7 { printf("at %s %s %s\n", $$6, $$7, $$8) }' >> $@.tmp6 @[ -s $@.tmp6 ] || ${ECHO} "<TR><TD><I>(no vulnerabilities list available)</I>" >> $@.tmp6 @${SED} -e 's|%%PORT%%|${PKGPATH}|g' \ -e '/%%PKG%%/r $@.tmp3' \ |