pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_chk 1.69.1: Add a -q option, which is a s...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/38415c0ba616
branches:  trunk
changeset: 510821:38415c0ba616
user:      tv <tv%pkgsrc.org@localhost>
date:      Tue Apr 04 18:38:13 2006 +0000

description:
1.69.1: Add a -q option, which is a superset of -n; squelches progress
messages and "echo-to-screen" commands (e.g., pkg_delete).  This provides
a much more accurate emulation of the former -c and -i options (now
-a -q and -u -q respectively), by suppressing messages not related to the
human-readable version information.

diffstat:

 pkgtools/pkg_chk/Makefile         |   4 ++--
 pkgtools/pkg_chk/files/pkg_chk.8  |  15 +++++++++++----
 pkgtools/pkg_chk/files/pkg_chk.sh |  25 +++++++++++++++----------
 3 files changed, 28 insertions(+), 16 deletions(-)

diffs (151 lines):

diff -r 33fe4d459024 -r 38415c0ba616 pkgtools/pkg_chk/Makefile
--- a/pkgtools/pkg_chk/Makefile Tue Apr 04 18:19:36 2006 +0000
+++ b/pkgtools/pkg_chk/Makefile Tue Apr 04 18:38:13 2006 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.28 2006/02/18 21:34:03 abs Exp $
+# $NetBSD: Makefile,v 1.29 2006/04/04 18:38:13 tv Exp $
 
-DISTNAME=      pkg_chk-1.69
+DISTNAME=      pkg_chk-1.69.1
 CATEGORIES=    pkgtools
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 33fe4d459024 -r 38415c0ba616 pkgtools/pkg_chk/files/pkg_chk.8
--- a/pkgtools/pkg_chk/files/pkg_chk.8  Tue Apr 04 18:19:36 2006 +0000
+++ b/pkgtools/pkg_chk/files/pkg_chk.8  Tue Apr 04 18:38:13 2006 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkg_chk.8,v 1.16 2006/02/18 21:34:03 abs Exp $
+.\"    $NetBSD: pkg_chk.8,v 1.17 2006/04/04 18:38:13 tv Exp $
 .\"
 .\" Copyright (c) 2001 by David Brownlee (abs%NetBSD.org@localhost)
 .\" Absolutely no warranty.
@@ -10,7 +10,7 @@
 .Nd check, and optionally update, installed packages
 .Sh SYNOPSIS
 .Nm
-.Op Fl aBbcfhiklNnrSsuv
+.Op Fl aBbcfhiklNnqrSsuv
 .Op Fl C Ar conf
 .Op Fl D Ar tags
 .Op Fl L Ar file
@@ -117,6 +117,13 @@
 is available, or
 .Dq Pa \&.
 otherwise.
+.It Fl q
+Do not display actions or take any action; only list information
+about package version differences.
+Useful for options that list information about package differences, such as
+.Fl a
+or
+.Fl u .
 .It Fl r
 Recursively delete any mismatched packages found.
 Use with care, this does not record which packages were installed
@@ -165,14 +172,14 @@
 .Pa pkgchk.conf .
 This is a synomyn for 
 .Nm
-.Fl a n ,
+.Fl a q ,
 and will be removed in a future version.
 .It Fl i
 Check versions of installed packages, ignoring
 .Pa pkgchk.conf.
 .Nm
 This is a synomyn for 
-.Fl u n ,
+.Fl u q ,
 and will be removed in a future version.
 .El
 .Sh FILE FORMAT
diff -r 33fe4d459024 -r 38415c0ba616 pkgtools/pkg_chk/files/pkg_chk.sh
--- a/pkgtools/pkg_chk/files/pkg_chk.sh Tue Apr 04 18:19:36 2006 +0000
+++ b/pkgtools/pkg_chk/files/pkg_chk.sh Tue Apr 04 18:38:13 2006 +0000
@@ -1,6 +1,6 @@
 #!@SH@ -e
 #
-# $Id: pkg_chk.sh,v 1.29 2006/02/18 21:34:03 abs Exp $
+# $Id: pkg_chk.sh,v 1.30 2006/04/04 18:38:13 tv Exp $
 #
 # TODO: Make -g check dependencies and tsort
 # TODO: Variation of -g which only lists top level packages
@@ -424,7 +424,9 @@
 
 msg_progress()
     {
-    msg "[ $@ ]"
+    if [ -z "$opt_q" ] ; then
+       msg "[ $@ ]"
+    fi
     }
 
 msg_n()
@@ -475,7 +477,7 @@
        run_cmd "cd $PKGSRCDIR/$PKGDIR && ${MAKE} update CLEANDEPENDS=yes"
     fi
 
-    if [ -z "$opt_n" -a ! -d $PKG_DBDIR/$PKGNAME ];then
+    if [ -z "$opt_n" -a -z "$opt_q" -a ! -d $PKG_DBDIR/$PKGNAME ];then
        FAIL=1
     fi
 
@@ -504,8 +506,10 @@
     else
        FAILOK=$opt_k
     fi
-    msg $(date +%R) $1
-    if [ -z "$opt_n" ];then
+    if [ -z "$opt_q" ];then
+       msg $(date +%R) $1
+    fi
+    if [ -z "$opt_n" -a -z "$opt_q" ];then
        if [ -n "$opt_L" ] ; then
            sh -c "$1" >> "$opt_L" 2>&1 || FAIL=1
        else
@@ -582,7 +586,7 @@
     fi
     }
 
-args=$(getopt BC:D:L:P:U:abcfghiklNnrsSuv $*)
+args=$(getopt BC:D:L:P:U:abcfghiklNnqrsSuv $*)
 if [ $? != 0 ]; then
     opt_h=1
 fi
@@ -593,18 +597,19 @@
        -B )    opt_B=1 ;;
        -b )    opt_b=1 ;;
        -C )    opt_C="$2" ; shift ;;
-       -c )    opt_a=1 ; opt_n=1 ; echo "-c is deprecated - use -a -n" ;;
+       -c )    opt_a=1 ; opt_q=1 ; echo "-c is deprecated - use -a -q" ;;
        -D )    opt_D="$2" ; shift ;;
        -f )    opt_f=1 ;;
        -g )    opt_g=1 ;;
        -h )    opt_h=1 ;;
-       -i )    opt_u=1 ; opt_n=1 ; echo "-i is deprecated - use -u -n" ;;
+       -i )    opt_u=1 ; opt_q=1 ; echo "-i is deprecated - use -u -q" ;;
        -k )    opt_k=1 ;;
        -L )    opt_L="$2" ; shift ;;
        -l )    opt_l=1 ;;
        -N )    opt_N=1 ;;
        -n )    opt_n=1 ;;
        -P )    opt_P="$2" ; shift ;;
+       -q )    opt_q=1 ; shift ;;
        -r )    opt_r=1 ;;
        -S )    opt_S=1 ;;
        -s )    opt_s=1 ;;
@@ -752,12 +757,12 @@
        if [ -f $PKGCHK_UPDATE_CONF ] ; then
            msg "Merging in previous $PKGCHK_UPDATE_CONF"
            tmp=$(cat $PKGCHK_UPDATE_CONF;echo $(pkgdirs_from_installed)|fmt -1)
-           if [ -z "$opt_n" ] ; then
+           if [ -z "$opt_n" -a -z "$opt_q" ] ; then
                echo $tmp | fmt -1 | ${SORT} -u > $PKGCHK_UPDATE_CONF
            fi
            tmp=
        else
-           if [ -z "$opt_n" ] ; then
+           if [ -z "$opt_n" -a -z "$opt_q" ] ; then
                echo $(pkgdirs_from_installed) | fmt -1 > $PKGCHK_UPDATE_CONF
            fi
        fi



Home | Main Index | Thread Index | Old Index