summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_chk
diff options
context:
space:
mode:
authortv <tv>2006-04-04 18:38:13 +0000
committertv <tv>2006-04-04 18:38:13 +0000
commit0173196e5d1619ebb49a63372a78467611df27c7 (patch)
treef6a557ad5bd2cf32054dcf73b53fc4400cfd690a /pkgtools/pkg_chk
parent92f9fe8384565d5c8159bc62f038e0747a49e8fe (diff)
downloadpkgsrc-0173196e5d1619ebb49a63372a78467611df27c7.tar.gz
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 (limited to 'pkgtools/pkg_chk')
-rw-r--r--pkgtools/pkg_chk/Makefile4
-rw-r--r--pkgtools/pkg_chk/files/pkg_chk.815
-rwxr-xr-xpkgtools/pkg_chk/files/pkg_chk.sh25
3 files changed, 28 insertions, 16 deletions
diff --git a/pkgtools/pkg_chk/Makefile b/pkgtools/pkg_chk/Makefile
index cd5443c2578..1d98a894ce2 100644
--- a/pkgtools/pkg_chk/Makefile
+++ b/pkgtools/pkg_chk/Makefile
@@ -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 --git a/pkgtools/pkg_chk/files/pkg_chk.8 b/pkgtools/pkg_chk/files/pkg_chk.8
index 114dffe9e96..b84859b4620 100644
--- a/pkgtools/pkg_chk/files/pkg_chk.8
+++ b/pkgtools/pkg_chk/files/pkg_chk.8
@@ -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)
.\" 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 @@ if
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 @@ Check versions of packages specified in
.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 --git a/pkgtools/pkg_chk/files/pkg_chk.sh b/pkgtools/pkg_chk/files/pkg_chk.sh
index 37fe0c98d41..4eab934bc40 100755
--- a/pkgtools/pkg_chk/files/pkg_chk.sh
+++ b/pkgtools/pkg_chk/files/pkg_chk.sh
@@ -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()
msg_progress()
{
- msg "[ $@ ]"
+ if [ -z "$opt_q" ] ; then
+ msg "[ $@ ]"
+ fi
}
msg_n()
@@ -475,7 +477,7 @@ pkg_install()
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 @@ run_cmd()
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 @@ verbose()
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 @@ while [ $# != 0 ]; do
-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 [ -n "$delete_and_recheck" ]; then
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