pkgsrc-Changes-HG archive

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

[pkgsrc/pkg_install-renovation]: pkgsrc/pkgtools/pkg_install Move to pkg_admi...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/8464192b6eef
branches:  pkg_install-renovation
changeset: 541533:8464192b6eef
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Sat Apr 26 18:37:10 2008 +0000

description:
Move to pkg_admin wrappers for audit-packages and
download-vulnerability-list.

diffstat:

 pkgtools/pkg_install/PLIST                                         |    9 +-
 pkgtools/pkg_install/files/Makefile.in                             |    4 +-
 pkgtools/pkg_install/files/admin/Makefile.in                       |   14 +-
 pkgtools/pkg_install/files/admin/audit-packages.sh.in              |  128 ++++++++++
 pkgtools/pkg_install/files/admin/download-vulnerability-list.sh.in |   37 ++
 5 files changed, 180 insertions(+), 12 deletions(-)

diffs (265 lines):

diff -r 41ec05aa23a7 -r 8464192b6eef pkgtools/pkg_install/PLIST
--- a/pkgtools/pkg_install/PLIST        Sat Apr 26 17:44:23 2008 +0000
+++ b/pkgtools/pkg_install/PLIST        Sat Apr 26 18:37:10 2008 +0000
@@ -1,6 +1,4 @@
-@comment $NetBSD: PLIST,v 1.10 2007/07/16 13:23:02 joerg Exp $
-man/cat1/audit-packages.0
-man/cat1/download-vulnerability-list.0
+@comment $NetBSD: PLIST,v 1.10.8.1 2008/04/26 18:37:10 joerg Exp $
 man/cat1/linkfarm.0
 man/cat1/pkg_add.0
 man/cat1/pkg_admin.0
@@ -8,11 +6,8 @@
 man/cat1/pkg_delete.0
 man/cat1/pkg_info.0
 man/cat1/pkg_view.0
-man/cat5/audit-packages.conf.0
 man/cat5/pkg_summary.0
 man/cat7/pkgsrc.0
-man/man1/audit-packages.1
-man/man1/download-vulnerability-list.1
 man/man1/linkfarm.1
 man/man1/pkg_add.1
 man/man1/pkg_admin.1
@@ -20,7 +15,6 @@
 man/man1/pkg_delete.1
 man/man1/pkg_info.1
 man/man1/pkg_view.1
-man/man5/audit-packages.conf.5
 man/man5/pkg_summary.5
 man/man7/pkgsrc.7
 sbin/audit-packages
@@ -32,4 +26,3 @@
 sbin/pkg_delete
 sbin/pkg_info
 sbin/pkg_view
-share/examples/pkg_install/audit-packages.conf
diff -r 41ec05aa23a7 -r 8464192b6eef pkgtools/pkg_install/files/Makefile.in
--- a/pkgtools/pkg_install/files/Makefile.in    Sat Apr 26 17:44:23 2008 +0000
+++ b/pkgtools/pkg_install/files/Makefile.in    Sat Apr 26 18:37:10 2008 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile.in,v 1.8.8.1 2008/04/26 17:44:23 joerg Exp $
+# $NetBSD: Makefile.in,v 1.8.8.2 2008/04/26 18:37:10 joerg Exp $
 
 BOOTSTRAP=     @bootstrap@
 
 .if empty(BOOTSTRAP)
-SUBDIRS=       lib add admin create delete info view audit-packages
+SUBDIRS=       lib add admin create delete info view
 .else
 SUBDIRS=       lib admin create info
 .endif
diff -r 41ec05aa23a7 -r 8464192b6eef pkgtools/pkg_install/files/admin/Makefile.in
--- a/pkgtools/pkg_install/files/admin/Makefile.in      Sat Apr 26 17:44:23 2008 +0000
+++ b/pkgtools/pkg_install/files/admin/Makefile.in      Sat Apr 26 18:37:10 2008 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.in,v 1.15 2008/04/04 20:46:59 tnn Exp $
+# $NetBSD: Makefile.in,v 1.15.2.1 2008/04/26 18:37:10 joerg Exp $
 
 srcdir=                @srcdir@
 
@@ -23,6 +23,7 @@
 INSTALL=       @INSTALL@
 
 PROG=          pkg_admin
+SCRIPTS=       audit-packages download-vulnerability-list
 
 .if empty(BOOTSTRAP)
 LIBS=          -linstall -lbz2 -lfetch -lz @LIBS@
@@ -36,7 +37,7 @@
                -DSYSCONFDIR=\"$(sysconfdir)\"
 .endif
 
-all: $(PROG)
+all: $(PROG) $(SCRIPTS)
 
 .c.o:
        $(CC) $(DEFS) $(CPPFLAGS) $(CFLAGS) -c $<
@@ -52,5 +53,14 @@
        $(INSTALL) -m 755 -d ${DESTDIR}$(man1dir)
        $(INSTALL) -m 755 -d ${DESTDIR}$(cat1dir)
        $(INSTALL) $(PROG) ${DESTDIR}$(sbindir)/$(PROG)
+       $(INSTALL) -m 555 $(SCRIPTS) ${DESTDIR}$(sbindir)
        $(INSTALL) -m 444 $(PROG).1 ${DESTDIR}$(man1dir)/$(PROG).1
        $(INSTALL) -m 444 $(PROG).cat1 ${DESTDIR}$(cat1dir)/$(PROG).0
+
+audit-packages: audit-packages.sh.in
+       sed -e 's|@PKG_ADMIN@|${sbindir}/pkg_admin|' \
+           ${.CURDIR}/audit-packages.sh.in > $@
+
+download-vulnerability-list: download-vulnerability-list.sh.in
+       sed -e 's|@PKG_ADMIN@|${sbindir}/pkg_admin|' \
+           ${.CURDIR}/download-vulnerability-list.sh.in > $@
diff -r 41ec05aa23a7 -r 8464192b6eef pkgtools/pkg_install/files/admin/audit-packages.sh.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/pkg_install/files/admin/audit-packages.sh.in     Sat Apr 26 18:37:10 2008 +0000
@@ -0,0 +1,128 @@
+#!/bin/sh
+
+pkg_admin=@PKG_ADMIN@
+
+usage() {
+       echo 'Usage: audit-packages [-deqsVv] [-c config_file] [-F file]' >& $2
+       echo '                      [-g file] [-h file]' >& $2
+       echo '                      [-K pkg_dbdir] [-n package] [-p package]' >& $2
+       echo '                      [-Q varname] [-t type]' >& $2
+       echo "Please use \`\`pkg_admin fetch-pkg-vulnerabilities'' instead." >& $2
+       exit $1
+}
+
+do_pkgdb=
+do_eol=
+do_fetch=
+do_quiet=
+do_sign=
+do_verbose=
+do_check_file=
+do_check_pattern=
+do_check_installed=
+do_check_vul_file=
+do_limit_type=
+do_print_var=
+
+args=`getopt F:K:Q:Vc:deg:h:n:p:qst:v $*`
+if [ $? -ne 0 ]; then
+       usage 1 2
+fi
+
+set -- $args
+
+while [ $# -gt 0 ]; do
+       case "$1" in
+       -F)
+               do_check_file=$2
+               shift
+               ;;
+       -K)
+               do_pkgdb="$1 $2"
+               shift
+               ;;
+       -Q)
+               do_print_var="$2"
+               shift
+               ;;
+       -V)
+               exec ${pkg_admin} -V
+               ;;
+       -c)
+               echo "The audit-packages wrapper does not support -c" >&2
+               echo "Please switch to \`\`pkg_admin fetch-pkg-vulnerabilities''." >&2
+               exit 1
+               ;;
+       -d)
+               do_fetch=1
+               ;;
+       -e)
+               do_eol=-e
+               ;;
+       -g)
+               echo "The audit-packages wrapper does not support -g" >&2
+               echo "Please switch to \`\`pkg_admin fetch-pkg-vulnerabilities''." >&2
+               exit 1
+               ;;
+       -h)
+               do_check_vul_file=$2
+               shift
+               ;;
+       -n)
+               do_check_pattern=$2
+               shift
+               ;;
+       -p)
+               do_check_installed=$2
+               shift
+               ;;
+       -q)
+               do_quiet=-q
+               ;;
+       -s)
+               do_sign=-s
+               ;;
+       -t)
+               do_limit_type="-t $2"
+               shift
+               ;;
+       -v)
+               do_verbose="$do_verbose -v"
+               ;;
+       esac
+       shift
+done
+
+if [ -n "${do_fetch}" ]; then
+       exec ${pkg_admin} ${do_pkgdb} fetch-pkg-vulnerabilities ${do_sign}
+fi
+
+if [ -n "${do_check_vul_file}" ]; then
+       exec ${pkg_admin} ${do_pkgdb} check-pkg-vulnerabilities ${do_sign} "${do_check_vul_file}"
+fi
+
+if [ -n "${do_print_var}" ]; then
+       exec ${pkg_admin} ${do_pkgdb} config-var "${do_print_var}"
+fi
+
+if [ -n "${do_check_file}" ]; then
+       if [ -n "${do_check_pattern}" -o -n "${do_check_installed}" ]; then
+               echo "Only one of -F, -n or -p is interpreted at a time." >& 2
+               usage 1 2
+       fi
+       exec ${pkg_admin} ${do_pkgdb} ${do_verbose} ${do_quiet} audit-pkg \
+           ${do_eol} ${do_limit_type} ${do_check_file}
+fi
+
+if [ -n "${do_check_pattern}" ]; then
+       if [ -n "${do_check_installed}" ]; then
+               echo "Only one of -F, -n or -p is interpreted at a time." >& 2
+               usage 1 2
+       fi
+       exec ${pkg_admin} ${do_pkgdb} ${do_verbose} ${do_quiet} audit-pkg \
+           ${do_eol} ${do_limit_type} ${do_check_pattern}
+fi
+
+# If do_check_installed is empty, all packages are checked.
+exec ${pkg_admin} ${do_pkgdb} ${do_verbose} ${do_quiet} audit \
+    ${do_eol} ${do_limit_type} ${do_check_installed}
diff -r 41ec05aa23a7 -r 8464192b6eef pkgtools/pkg_install/files/admin/download-vulnerability-list.sh.in
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/pkg_install/files/admin/download-vulnerability-list.sh.in        Sat Apr 26 18:37:10 2008 +0000
@@ -0,0 +1,37 @@
+#!/bin/sh
+
+pkg_admin=@PKG_ADMIN@
+
+usage() {
+       echo 'Usage: download-vulnerability-list -hs [-c config_file]' >& $2
+       echo "Please use \`\`pkg_admin fetch-pkg-vulnerabilities'' instead." >& $2
+       exit $1
+}
+
+do_sign=
+
+args=`getopt c:hs $*`
+if [ $? -ne 0 ]; then
+       usage 1 2
+fi
+
+set -- $args
+
+while [ $# -gt 0 ]; do
+       case "$1" in
+       -c)
+               echo "The download-vulnerability-list wrapper does not support -c" >&2
+               echo "Please switch to \`\`pkg_admin fetch-pkg-vulnerabilities''." >&2
+               exit 1
+               ;;
+       -h)
+               usage 0 1
+               ;;
+       -s)
+               do_sign=-s
+               ;;
+       esac
+       shift
+done
+
+exec ${pkg_admin} fetch-pkg-vulnerabilities ${do_sign}



Home | Main Index | Thread Index | Old Index