pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/scripts Be more intelligent when setting PVDIR. If...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/383df86a4929
branches:  trunk
changeset: 531611:383df86a4929
user:      adrianp <adrianp%pkgsrc.org@localhost>
date:      Thu Aug 02 22:42:05 2007 +0000

description:
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:

 mk/scripts/mkreadme |  20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diffs (43 lines):

diff -r bf690f102df7 -r 383df86a4929 mk/scripts/mkreadme
--- a/mk/scripts/mkreadme       Thu Aug 02 22:36:44 2007 +0000
+++ b/mk/scripts/mkreadme       Thu Aug 02 22:42:05 2007 +0000
@@ -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 @@
 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 @@
     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}\""
+
 
 ######################################################################
 #



Home | Main Index | Thread Index | Old Index