From 2ad9706a17442042a56b2fd251441ea4e2a9faff Mon Sep 17 00:00:00 2001 From: adrianp Date: Thu, 2 Aug 2007 22:42:05 +0000 Subject: 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. --- mk/scripts/mkreadme | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'mk/scripts') 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}\"" + ###################################################################### # -- cgit v1.2.3