pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc Update pkgtools/pkg_chk to 1.82:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ed0b8716feca
branches:  trunk
changeset: 519359:ed0b8716feca
user:      abs <abs%pkgsrc.org@localhost>
date:      Mon Oct 02 07:33:38 2006 +0000

description:
Update pkgtools/pkg_chk to 1.82:
    - Is '*' is passed to -U, unset all tags
    - Implement -p, to display all the pkgdirs for a given set of tags

diffstat:

 doc/CHANGES-2006                  |   3 +-
 pkgtools/pkg_chk/Makefile         |   4 +-
 pkgtools/pkg_chk/files/pkg_chk.8  |  13 ++++++++--
 pkgtools/pkg_chk/files/pkg_chk.sh |  47 +++++++++++++++++++++++++++++---------
 4 files changed, 50 insertions(+), 17 deletions(-)

diffs (186 lines):

diff -r 8c808e18153f -r ed0b8716feca doc/CHANGES-2006
--- a/doc/CHANGES-2006  Mon Oct 02 01:59:33 2006 +0000
+++ b/doc/CHANGES-2006  Mon Oct 02 07:33:38 2006 +0000
@@ -1,4 +1,4 @@
->$NetBSD: CHANGES-2006,v 1.1368 2006/10/02 01:44:47 schmonz Exp $
+>$NetBSD: CHANGES-2006,v 1.1369 2006/10/02 07:34:08 abs Exp $
 
 Changes to the packages collection and infrastructure in 2006:
 
@@ -4521,3 +4521,4 @@
        Updated devel/p5-SVN-Notify to 2.64 [seb 2006-10-01]
        Updated net/net-snmp to 5.3.1nb1 [seb 2006-10-02]
        Updated mail/getmail to 4.6.4 [schmonz 2006-10-02]
+       Updated pkgtools/pkg_chk to 1.82 [abs 2006-10-02]
diff -r 8c808e18153f -r ed0b8716feca pkgtools/pkg_chk/Makefile
--- a/pkgtools/pkg_chk/Makefile Mon Oct 02 01:59:33 2006 +0000
+++ b/pkgtools/pkg_chk/Makefile Mon Oct 02 07:33:38 2006 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.44 2006/09/20 21:54:13 abs Exp $
+# $NetBSD: Makefile,v 1.45 2006/10/02 07:33:38 abs Exp $
 
-DISTNAME=      pkg_chk-1.81
+DISTNAME=      pkg_chk-1.82
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 8c808e18153f -r ed0b8716feca pkgtools/pkg_chk/files/pkg_chk.8
--- a/pkgtools/pkg_chk/files/pkg_chk.8  Mon Oct 02 01:59:33 2006 +0000
+++ b/pkgtools/pkg_chk/files/pkg_chk.8  Mon Oct 02 07:33:38 2006 +0000
@@ -1,16 +1,16 @@
-.\"    $NetBSD: pkg_chk.8,v 1.23 2006/09/28 09:36:44 dillo Exp $
+.\"    $NetBSD: pkg_chk.8,v 1.24 2006/10/02 07:33:38 abs Exp $
 .\"
 .\" Copyright (c) 2001 by David Brownlee (abs%NetBSD.org@localhost)
 .\" Absolutely no warranty.
 .\"
-.Dd April 4, 2006
+.Dd September 29, 2006
 .Dt PKG_CHK 8
 .Sh NAME
 .Nm pkg_chk
 .Nd check, and optionally update, installed packages
 .Sh SYNOPSIS
 .Nm
-.Op Fl aBbcfhiklNnqrsuv
+.Op Fl aBbcfhiklNnpqrsuv
 .Op Fl C Ar conf
 .Op Fl D Ar tags
 .Op Fl L Ar file
@@ -113,6 +113,8 @@
 is available, or
 .Dq Pa \&.
 otherwise.
+.It Fl p
+Print list of package directories that will be checked, then exit.
 .It Fl q
 Do not display actions or take any action; only list information
 about package version differences.
@@ -139,6 +141,11 @@
 .Ev PKGCHK_NOTAGS .
 Package directories can also be skipped by listing them under
 .Fl U .
+Passing
+.Sq *
+to
+.Fl U
+will result in all default tags being unset
 .It Fl u
 Automatically update any missing packages.
 If a binary package exists in
diff -r 8c808e18153f -r ed0b8716feca pkgtools/pkg_chk/files/pkg_chk.sh
--- a/pkgtools/pkg_chk/files/pkg_chk.sh Mon Oct 02 01:59:33 2006 +0000
+++ b/pkgtools/pkg_chk/files/pkg_chk.sh Mon Oct 02 07:33:38 2006 +0000
@@ -1,6 +1,6 @@
 #!@SH@ -e
 #
-# $Id: pkg_chk.sh,v 1.42 2006/09/20 21:54:13 abs Exp $
+# $Id: pkg_chk.sh,v 1.43 2006/10/02 07:33:38 abs Exp $
 #
 # TODO: Make -g check dependencies and tsort
 # TODO: Variation of -g which only lists top level packages
@@ -340,15 +340,27 @@
                opt_U="$PKGCHK_NOTAGS"
        fi
     fi
-    if [ -n "$opt_D" ];then
-       TAGS="$TAGS,$opt_D"
+
+    # If '-U' contains a '*' then we need to unset TAGS and PKGCHK_TAGS, but
+    # still pick up -D, and even package specific -U options
+    verbose "unset TAGS=$opt_U"
+    case ",$opt_U," in
+       *,\*,*)
+           TAGS=''
+           ;;
+    esac
+    if [ -n "$TAGS" ];then
+       if [ -n "$opt_D" ];then
+               opt_D="$opt_D,$TAGS"
+       else
+               opt_D="$TAGS"
+       fi
     fi
-    verbose "set   TAGS=$TAGS"
-    verbose "unset TAGS=$opt_U"
+    verbose "set   TAGS=$opt_D"
 
     # Extract list of valid pkgdirs (skip any 'alreadyset' in $LIST)
     #
-    LIST="$LIST "$(${AWK} -v alreadyset="$LIST" -v setlist=$TAGS -v unsetlist=$opt_U '
+    LIST="$LIST "$(${AWK} -v alreadyset="$LIST" -v setlist="$opt_D" -v unsetlist="$opt_U" '
     BEGIN {
        split(alreadyset, tmp, " ");
        for (tag in tmp) { skip[tmp[tag]] = 1; }
@@ -566,11 +578,12 @@
        -l      List binary packages including dependencies (implies -c)
        -N      List installed packages for which a newer version is in TODO
        -n      Display actions that would be taken, but do not perform them
+       -p      Display the list of pkgdirs that match the current tags
        -P dir  Set PACKAGES dir (overrides any other setting)
        -q      Do not display actions or take any action; only list packages
        -r      Recursively remove mismatches (use with care) (implies -i)
        -s      Use source for building packages
-       -U tags Comma separated list of pkgchk.conf tags to unset
+       -U tags Comma separated list of pkgchk.conf tags to unset ('*' for all)
        -u      Update all mismatched packages (implies -i)
        -v      Verbose
 
@@ -601,11 +614,13 @@
     fi
     }
 
-args=$(getopt BC:D:L:P:U:abcfghiklNnqrsSuv $*)
+args=$(getopt BC:D:L:P:U:abcfghiklNnpqrsSuv "$@")
 if [ $? != 0 ]; then
     opt_h=1
 fi
+set -o noglob # -U can be '*'
 set -- $args
+set +o noglob
 while [ $# != 0 ]; do
     case "$1" in
        -a )    opt_a=1 ;;
@@ -623,6 +638,7 @@
        -l )    opt_l=1 ;;
        -N )    opt_N=1 ;;
        -n )    opt_n=1 ;;
+       -p )    opt_p=1 ;;
        -P )    opt_P="$2" ; shift ;;
        -q )    opt_q=1 ;;
        -r )    opt_r=1 ;;
@@ -639,15 +655,19 @@
     opt_b=1; opt_s=1;
 fi
 
-if [ -z "$opt_a$opt_g$opt_l$opt_r$opt_u$opt_N" ];
+if [ -z "$opt_a$opt_g$opt_l$opt_p$opt_r$opt_u$opt_N" ];
 then
-    usage "Must specify at least one of -a, -g, -l, -r, -u or -N";
+    usage "Must specify at least one of -a, -g, -l, -p, -r, -u or -N";
 fi
 
-if [ -n "$opt_h" -o $# != 0 ];then
+if [ -n "$opt_h" ];then
     usage
 fi
 
+if [ $# != 0 ];then
+    usage "Additional argument ($*) given"
+fi
+
 TMPDIR=`mktemp -d /tmp/${0##*/}.XXXXXX`
 TMPFILE=$TMPDIR/tmp
 
@@ -760,6 +780,11 @@
     PKGDIRLIST=$(pkgdirs_from_installed)
 fi
 
+if [ -n "$opt_p" ] ; then
+    pkgdirs_from_conf $PKGCHK_CONF $PKGDIRLIST | tr ' ' '\n'
+    exit
+fi
+
 if [ -n "$opt_a" -o -n "$opt_l" ];then # Append to PKGDIRLIST based on conf
     verbose "Append to PKGDIRLIST based on config $PKGCHK_CONF"
     PKGDIRLIST="$(pkgdirs_from_conf $PKGCHK_CONF $PKGDIRLIST)"



Home | Main Index | Thread Index | Old Index