summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authoradrianp <adrianp@pkgsrc.org>2007-08-02 22:42:05 +0000
committeradrianp <adrianp@pkgsrc.org>2007-08-02 22:42:05 +0000
commit7178eb82cecf8acb8917d5be9b5e5cf88c77243e (patch)
tree762d36c8e859c02d3822aba7eb3372a4e0599fc4 /mk
parenta5e1419b95d2eeeead6d6fa88f15245cdd1ba402 (diff)
downloadpkgsrc-7178eb82cecf8acb8917d5be9b5e5cf88c77243e.tar.gz
Be more intelligent when setting PVDIR. If pkg_install<20070714 then use
PKGVULNDIR; else extract the current setting using audit-packages -Q and use that. In addition to this mkreadme can still be called with -V to specify a pkg-vulnerabilities file that will override any automatic detection.
Diffstat (limited to 'mk')
-rwxr-xr-xmk/scripts/mkreadme20
1 files changed, 14 insertions, 6 deletions
diff --git a/mk/scripts/mkreadme b/mk/scripts/mkreadme
index 5ee162b6e0d..caf4d4b83e7 100755
--- a/mk/scripts/mkreadme
+++ b/mk/scripts/mkreadme
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: mkreadme,v 1.16 2007/05/28 11:07:00 martti Exp $
+# $NetBSD: mkreadme,v 1.17 2007/08/02 22:42:05 adrianp Exp $
#
# Script for README.html generation
#
@@ -286,7 +286,8 @@ echo " "
if [ -d ${PKGSRCDIR}/pkgtools/prereq-readme ]; then
cd ${PKGSRCDIR}/pkgtools/prereq-readme
for v in CDROM_PKG_URL_HOST CDROM_PKG_URL_DIR DISTDIR \
- FTP_PKG_URL_HOST FTP_PKG_URL_DIR PACKAGES PKG_INFO PKG_SUFX
+ FTP_PKG_URL_HOST FTP_PKG_URL_DIR PACKAGES PKG_INFO PKG_SUFX PKG_ADMIN \
+ AUDIT_PACKAGES_FLAGS PKGVULNDIR PKGTOOLS_VERSION
do
val=`${BMAKE} show-var VARNAME=${v}`
if [ $? != 0 ]; then
@@ -302,11 +303,18 @@ else
exit 1
fi
-# this needs to happen here as DISTDIR has not been populated until this
-# stage (see above)
-if [ "x$pv" = "xdefault" ]; then
- PVDIR=$DISTDIR
+# this needs to happen here as the variables referenced have not been
+# populated until this stage (see above)
+#
+if [ "$pv" = "default" ]; then
+ if ${PKG_ADMIN} pmatch 'pkg_install<20070714' pkg_install-${PKGTOOLS_VERSION}; then
+ PVDIR=$PKGVULNDIR
+ else
+ PVDIR=`audit-packages ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`
+ fi
fi
+ echo "----> PVDIR=\"${PVDIR}\""
+
######################################################################
#