summaryrefslogtreecommitdiff
path: root/mk/scripts/mkreadme
diff options
context:
space:
mode:
authorjoerg <joerg>2008-04-18 14:26:36 +0000
committerjoerg <joerg>2008-04-18 14:26:36 +0000
commite8da622d201fb99cc39f6aa6ed0d67d0c4577101 (patch)
tree45173f7247afdbad40928c6389756c3703e7ca05 /mk/scripts/mkreadme
parent98316d5046757ffa923274c7807a20ced8efbc5e (diff)
downloadpkgsrc-e8da622d201fb99cc39f6aa6ed0d67d0c4577101.tar.gz
Change the code generation README.html to use the new
"pkg_admin audit-history" command to print the full list of vulnerabilities and use further pkg_admin pmatch logic to mark them as fixed or still open. For pkg_install versions before 20080415, skip the vulnerability processing. Discussed with: dmcmahill
Diffstat (limited to 'mk/scripts/mkreadme')
-rwxr-xr-xmk/scripts/mkreadme36
1 files changed, 15 insertions, 21 deletions
diff --git a/mk/scripts/mkreadme b/mk/scripts/mkreadme
index 1f40258b56a..1728ee6881f 100755
--- a/mk/scripts/mkreadme
+++ b/mk/scripts/mkreadme
@@ -1,5 +1,5 @@
#!/bin/sh
-# $NetBSD: mkreadme,v 1.22 2008/03/15 16:27:43 joerg Exp $
+# $NetBSD: mkreadme,v 1.23 2008/04/18 14:26:37 joerg Exp $
#
# Script for README.html generation
#
@@ -63,7 +63,6 @@ usage(){
echo " [-P|--packages directory] [-r|--restart] "
echo " [-s|--summary]"
echo " [-S|--save-database]"
- echo " [-V|--pkg-vuln directory]"
echo " "
echo " $prog -h|--help"
echo " "
@@ -99,9 +98,6 @@ usage(){
echo " This is useful for debugging or re-running this script"
echo " with the -r option."
echo " "
- echo " -V|--pkg-vuln dir Specify the pkg-vulnerability directory."
- echo " Defaults to the value of the DISTDIR."
- echo " "
echo " -v|--version Displays the version of this script and exits."
echo " "
echo "Example: $prog -p /pub/NetBSD/packages/pkgsrc -P /pub/NetBSD/packages -f"
@@ -210,13 +206,6 @@ do
exit 0
;;
- # Specify pkg-vulnerability directory
- -V|--pkg-vuln)
- PVDIR=$2
- pv=custom
- shift 2
- ;;
-
-*) echo "$prog: ERROR: $1 is not a valid option"
usage
clean_and_exit
@@ -303,14 +292,19 @@ else
exit 1
fi
-# this needs to happen here as the variables referenced have not been
-# populated until this stage (see above)
-#
-if [ "$pv" = "default" ]; then
- PVDIR=`${AUDIT_PACKAGES} ${AUDIT_PACKAGES_FLAGS} -Q PKGVULNDIR`
+if [ `${PKG_ADMIN} -V` -lt 20080415 ]; then
+ SCAN_VULNERABILITIES=0
+ echo "----> NOT checking for vulnerabilities, pkg_install too old"
+else
+ _PVDIR=`${PKG_ADMIN} config-var PKGVULNDIR`;
+ if [ -e "${_PVDIR}"/pkg-vulnerabilities ]; then
+ SCAN_VULNERABILITIES=2
+ echo "----> Checking for vulnerabilities"
+ else
+ SCAN_VULNERABILITIES=1
+ echo "----> NOT checking for vulnerabilities"
+ fi
fi
-echo "----> PVDIR=\"${PVDIR}\""
-
######################################################################
#
@@ -432,7 +426,6 @@ ${AWK} -f ${PKGSRCDIR}/mk/scripts/genreadme.awk \
debug=$debug \
dependsfile=${TMPDIR}/pkgsrc.depends.debug \
summary=${summary} \
- AUDIT_PACKAGES=$AUDIT_PACKAGES \
AWK=$AWK \
CMP=$CMP \
DISTDIR=$DISTDIR \
@@ -440,12 +433,13 @@ ${AWK} -f ${PKGSRCDIR}/mk/scripts/genreadme.awk \
GREP=$GREP \
GZIP_CMD="$GZIP_CMD" \
PACKAGES=$PACKAGES \
+ PKG_ADMIN="$PKG_ADMIN" \
PKG_INFO="$PKG_INFO" \
PKG_SUFX=$PKG_SUFX \
PKG_URL=$PKG_URL \
PKGSRCDIR=$PKGSRCDIR \
PKGTOOLS_VERSION=$PKGTOOLS_VERSION \
- PVDIR=$PVDIR \
+ SCAN_VULNERABILITIES=${SCAN_VULNERABILITIES} \
SED=$SED \
SETENV=$SETENV \
SORT=$SORT \