diff options
author | adrianp <adrianp@pkgsrc.org> | 2007-02-18 00:08:36 +0000 |
---|---|---|
committer | adrianp <adrianp@pkgsrc.org> | 2007-02-18 00:08:36 +0000 |
commit | e345235eb8ed4ab6453ff08472d16469d6f4abf6 (patch) | |
tree | 8b5ad8db68154ec7b1e9c4dffc26d68fe6c4cd47 | |
parent | 61deab4ce920573a02efb4e9c208859b1fb84711 (diff) | |
download | pkgsrc-e345235eb8ed4ab6453ff08472d16469d6f4abf6.tar.gz |
* Add an extra -V option to mkreadme to support a non-standard PKGVULNDIR
* Add the necessary changes to allow genreadme.awk to process the v1.1.0
format pkg-vulnerabilities file.
* Changes are fully backward compatable i.e. mkreadme should be able to
parse v1.0.0 and v1.1.0 format files.
-rwxr-xr-x | mk/scripts/genreadme.awk | 18 | ||||
-rwxr-xr-x | mk/scripts/mkreadme | 23 |
2 files changed, 33 insertions, 8 deletions
diff --git a/mk/scripts/genreadme.awk b/mk/scripts/genreadme.awk index fc34671208c..2ef3ebcea2c 100755 --- a/mk/scripts/genreadme.awk +++ b/mk/scripts/genreadme.awk @@ -1,5 +1,5 @@ #!/usr/bin/awk -f -# $NetBSD: genreadme.awk,v 1.25 2006/12/15 13:15:06 martti Exp $ +# $NetBSD: genreadme.awk,v 1.26 2007/02/18 00:08:36 adrianp Exp $ # # Copyright (c) 2002, 2003, 2005, 2006 The NetBSD Foundation, Inc. # All rights reserved. @@ -255,7 +255,7 @@ END { } close(builddependsfile); - vfile = DISTDIR "/pkg-vulnerabilities"; + vfile = PVDIR "/pkg-vulnerabilities"; # extract date for vulnerabilities file cmd = "ls -l " vfile; @@ -275,16 +275,22 @@ END { vul_minor = vul_format[2]; vul_teeny = vul_format[3]; } - if ($0 !~ /^\#/) { + if ( $0 ~ /^-----BEGIN PGP SIGNATURE-----.*/ ) { + break; + } + if ( ( $0 !~ /^\#/ ) && + ( $0 !~ /^Hash:.*/ ) && + ( $0 !~ /^-----BEGIN PGP SIGNED.*/ ) && + ( $0 != "" ) ) { vulpkg[i] = $1; vultype[i] = $2; vulref[i] = $3; i = i + 1; } } - if( (vul_major != 1) || - (vul_minor != 0) || - (vul_teeny != 1) ) { + if( (vul_major > 1) || + (vul_minor > 1) || + (vul_teeny > 0) ) { printf("Version %d.%d.%d of the vulnerability file is out of sync with", vul_major, vul_minor, vul_teeny); printf("the genreadme.awk script\n"); diff --git a/mk/scripts/mkreadme b/mk/scripts/mkreadme index 3fcc1bcd1c8..0f838dbe307 100755 --- a/mk/scripts/mkreadme +++ b/mk/scripts/mkreadme @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: mkreadme,v 1.14 2007/01/08 20:52:59 adrianp Exp $ +# $NetBSD: mkreadme,v 1.15 2007/02/18 00:08:36 adrianp Exp $ # # Script for README.html generation # @@ -63,6 +63,7 @@ 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 " " @@ -82,7 +83,7 @@ usage(){ echo " -h|--help Displays this help message" echo " " echo " -p|--pkgsrc dir Specifies the pkgsrc directory. Defaults to" - echo " The value of the PKGSRCDIR environment variable" + echo " the value of the PKGSRCDIR environment variable" echo " if set or /usr/pkgsrc otherwise." echo " " echo " -P|--packages dir Specifies the packages directory." @@ -98,6 +99,9 @@ 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" @@ -129,6 +133,7 @@ restart=no prune=no DEBUG=no save=no +pv=default summary="" @@ -205,6 +210,13 @@ 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 @@ -290,6 +302,12 @@ 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 +fi + ###################################################################### # # Decide on FTP vs CDROM README.html files @@ -421,6 +439,7 @@ ${AWK} -f ${PKGSRCDIR}/mk/scripts/genreadme.awk \ PKG_SUFX=$PKG_SUFX \ PKG_URL=$PKG_URL \ PKGSRCDIR=$PKGSRCDIR \ + PVDIR=$PVDIR \ SED=$SED \ SETENV=$SETENV \ SORT=$SORT \ |