pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk * Rename AP var to AUDIT_PACKAGES as the former was...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8e8414851b8b
branches:  trunk
changeset: 537100:8e8414851b8b
user:      adrianp <adrianp%pkgsrc.org@localhost>
date:      Thu Jan 03 20:51:21 2008 +0000

description:
* Rename AP var to AUDIT_PACKAGES as the former was a bit obscure
* Add DOWNLOAD_VULN_LIST var
* Get AUDIT_PACKAGES and DOWNLOAD_VULN_LIST to point to the right binaries
  taking into consideration OPSYS and pkg_install version
* Replace all references to audit-packages and download-vulnerability-list
  with AUDIT_PACKAGES and DOWNLOAD_VULN_LIST

diffstat:

 mk/bsd.pkg.readme.mk         |   9 +++++----
 mk/flavor/pkg/check.mk       |  10 +++++-----
 mk/flavor/pkg/flavor-vars.mk |  14 +++++++++-----
 mk/scripts/genreadme.awk     |   4 ++--
 mk/scripts/mkreadme          |   9 +++++----
 5 files changed, 26 insertions(+), 20 deletions(-)

diffs (164 lines):

diff -r 66b1c9ba2595 -r 8e8414851b8b mk/bsd.pkg.readme.mk
--- a/mk/bsd.pkg.readme.mk      Thu Jan 03 20:26:09 2008 +0000
+++ b/mk/bsd.pkg.readme.mk      Thu Jan 03 20:51:21 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.readme.mk,v 1.15 2007/10/20 13:35:12 adrianp Exp $
+# $NetBSD: bsd.pkg.readme.mk,v 1.16 2008/01/03 20:51:21 adrianp Exp $
 #
 # This Makefile fragment is included by bsd.pkg.mk and encapsulates the
 # code to produce README.html files in each package directory.
@@ -248,9 +248,9 @@
                                ${PKGVULNDIR}/pkg-vulnerabilities;      \
                fi;                                                     \
        else                                                            \
-               _PKGVULNDIR=`audit-packages ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`; \
+               _PKGVULNDIR=`${AUDIT_PACKAGES} ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`; \
                if [ -f $$_PKGVULNDIR/pkg-vulnerabilities ]; then       \
-                       audit-packages ${AUDIT_PACKAGES_FLAGS} -n ${PKGNAME} 2>&1| ${AWK} \
+                       ${AUDIT_PACKAGES} ${AUDIT_PACKAGES_FLAGS} -n ${PKGNAME} 2>&1| ${AWK} \
                                '{ printurl = $$8;                      \
                                gsub("\<", "\\&lt;", $$2);              \
                                gsub("\>", "\\&gt;", $$2);              \
@@ -284,11 +284,12 @@
        if ${PKG_ADMIN} pmatch 'pkg_install<20070714' pkg_install-${PKGTOOLS_VERSION}; then \
                _PVDIR=${PKGVULNDIR};                                   \
        else                                                            \
-               _PVDIR=`audit-packages ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`; \
+               _PVDIR=`${AUDIT_PACKAGES} ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`; \
        fi; \
        ${AWK} -f ../../mk/scripts/genreadme.awk \
                builddependsfile=/dev/null \
                dependsfile=/dev/null \
+               AUDIT_PACKAGES=${AUDIT_PACKAGES:Q} \
                AWK=${AWK:Q} \
                CMP=${CMP:Q} \
                DISTDIR=${DISTDIR:Q} \
diff -r 66b1c9ba2595 -r 8e8414851b8b mk/flavor/pkg/check.mk
--- a/mk/flavor/pkg/check.mk    Thu Jan 03 20:26:09 2008 +0000
+++ b/mk/flavor/pkg/check.mk    Thu Jan 03 20:51:21 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: check.mk,v 1.5 2007/08/04 11:21:08 adrianp Exp $
+# $NetBSD: check.mk,v 1.6 2008/01/03 20:51:21 adrianp Exp $
 #
 
 # _flavor-check-vulnerable:
@@ -17,7 +17,7 @@
                        ${PHASE_MSG} "Skipping vulnerability checks.";  \
                        ${WARNING_MSG} "No $$vulnfile file found.";     \
                        ${WARNING_MSG} "To fix, install the pkgsrc/security/audit-packages"; \
-                       ${WARNING_MSG} "package and run: \`\`${LOCALBASE}/sbin/download-vulnerability-list''."; \
+                       ${WARNING_MSG} "package and run: \`${DOWNLOAD_VULN_LIST}'."; \
                        exit 0;                                         \
                fi;                                                     \
                ${PHASE_MSG} "Checking for vulnerabilities in ${PKGNAME}"; \
@@ -48,16 +48,16 @@
                        ${FALSE};                                       \
                fi;                                                     \
        else                                                            \
-               _PKGVULNDIR=`audit-packages ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`; \
+               _PKGVULNDIR=`${AUDIT_PACKAGES} ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`; \
                vulnfile=$$_PKGVULNDIR/pkg-vulnerabilities;             \
                if ${TEST} ! -f "$$vulnfile"; then                      \
                        ${PHASE_MSG} "Skipping vulnerability checks.";  \
                        ${WARNING_MSG} "No $$vulnfile file found.";     \
-                       ${WARNING_MSG} "To fix run: \`download-vulnerability-list'."; \
+                       ${WARNING_MSG} "To fix run: \`${DOWNLOAD_VULN_LIST}'."; \
                        exit 0;                                         \
                fi;                                                     \
                ${PHASE_MSG} "Checking for vulnerabilities in ${PKGNAME}"; \
-               audit-packages ${AUDIT_PACKAGES_FLAGS} -n ${PKGNAME};   \
+               ${AUDIT_PACKAGES} ${AUDIT_PACKAGES_FLAGS} -n ${PKGNAME};        \
                if ${TEST} "$$?" -ne 0; then                            \
                        ${ERROR_MSG} "Define ALLOW_VULNERABLE_PACKAGES in mk.conf or IGNORE_URLS in audit-packages.conf(5) if this package is absolutely essential."; \
                        ${FALSE};                                       \
diff -r 66b1c9ba2595 -r 8e8414851b8b mk/flavor/pkg/flavor-vars.mk
--- a/mk/flavor/pkg/flavor-vars.mk      Thu Jan 03 20:26:09 2008 +0000
+++ b/mk/flavor/pkg/flavor-vars.mk      Thu Jan 03 20:51:21 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: flavor-vars.mk,v 1.5 2007/12/16 01:49:08 adrianp Exp $
+# $NetBSD: flavor-vars.mk,v 1.6 2008/01/03 20:51:21 adrianp Exp $
 #
 # This Makefile fragment is included indirectly by bsd.prefs.mk and
 # defines some variables which must be defined earlier than where
@@ -45,15 +45,19 @@
 # should pick the correct version to run.
 #
 .if defined(OPSYS) && ${OPSYS} != "NetBSD"
-AP?=   ${PKG_TOOLS_BIN}/audit-packages
+AUDIT_PACKAGES?=       ${PKG_TOOLS_BIN}/audit-packages
+DOWNLOAD_VULN_LIST?=   ${PKG_TOOLS_BIN}/download-vulnerability-list
 .else
 .      if exists(${LOCALBASE}/sbin/audit-packages)
-AP?=           ${LOCALBASE}/sbin/audit-packages
+AUDIT_PACKAGES?=       ${LOCALBASE}/sbin/audit-packages
+DOWNLOAD_VULN_LIST?=   ${LOCALBASE}/sbin/download-vulnerability-list
 .      else
 .              if exists(/usr/sbin/audit-packages)
-AP?=                   /usr/sbin/audit-packages
+AUDIT_PACKAGES?=       /usr/sbin/audit-packages
+DOWNLOAD_VULN_LIST?=   /usr/sbin/download-vulnerability-list
 .              else
-AP?=                   audit-packages
+AUDIT_PACKAGES?=       audit-packages
+DOWNLOAD_VULN_LIST?=   download-vulnerability-list
 .              endif
 .      endif
 .endif
diff -r 66b1c9ba2595 -r 8e8414851b8b mk/scripts/genreadme.awk
--- a/mk/scripts/genreadme.awk  Thu Jan 03 20:26:09 2008 +0000
+++ b/mk/scripts/genreadme.awk  Thu Jan 03 20:51:21 2008 +0000
@@ -1,5 +1,5 @@
 #!/usr/bin/awk -f
-# $NetBSD: genreadme.awk,v 1.29 2007/10/20 13:35:12 adrianp Exp $
+# $NetBSD: genreadme.awk,v 1.30 2008/01/03 20:51:22 adrianp Exp $
 #
 # Copyright (c) 2002, 2003, 2005, 2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -418,7 +418,7 @@
                                         toppkg, pkg);
                                }
 
-                               cmd = sprintf("audit-packages -n %s", pkg);
+                               cmd = sprintf("%s -n %s", AUDIT_PACKAGES, pkg);
                                while (cmd | getline vuln_entry) {
                                        split(vuln_entry, entry, " ");
                                        vul =  sprintf("%s<LI><STRONG>%s has a <a href=\"%s\">%s</a> vulnerability</STRONG></LI>\n",
diff -r 66b1c9ba2595 -r 8e8414851b8b mk/scripts/mkreadme
--- a/mk/scripts/mkreadme       Thu Jan 03 20:26:09 2008 +0000
+++ b/mk/scripts/mkreadme       Thu Jan 03 20:51:21 2008 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkreadme,v 1.20 2007/10/20 13:35:12 adrianp Exp $
+# $NetBSD: mkreadme,v 1.21 2008/01/03 20:51:22 adrianp Exp $
 #
 # Script for README.html generation
 #
@@ -287,7 +287,7 @@
     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 PKG_ADMIN \
-       AUDIT_PACKAGES_FLAGS PKGVULNDIR PKGTOOLS_VERSION
+       AUDIT_PACKAGES AUDIT_PACKAGES_FLAGS PKGTOOLS_VERSION
     do
        val=`${BMAKE} show-var VARNAME=${v}`
        if [ $? != 0 ]; then
@@ -308,9 +308,9 @@
 #
 if [ "$pv" = "default" ]; then
     if ${PKG_ADMIN} pmatch 'pkg_install<20070714' pkg_install-${PKGTOOLS_VERSION}; then
-        PVDIR=$PKGVULNDIR
+       PVDIR=`${BMAKE} show-var VARNAME=PKGVULNDIR`
     else
-       PVDIR=`audit-packages ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`
+       PVDIR=`${AUDIT_PACKAGES} ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`
     fi
 fi
        echo "---->  PVDIR=\"${PVDIR}\""
@@ -436,6 +436,7 @@
     debug=$debug \
     dependsfile=${TMPDIR}/pkgsrc.depends.debug \
     summary=${summary} \
+    AUDIT_PACKAGES=$AUDIT_PACKAGES \
     AWK=$AWK \
     CMP=$CMP \
     DISTDIR=$DISTDIR \



Home | Main Index | Thread Index | Old Index