summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorabs <abs@pkgsrc.org>2001-08-23 11:55:16 +0000
committerabs <abs@pkgsrc.org>2001-08-23 11:55:16 +0000
commite4fc224719ffbd534203491fd6a913c015230686 (patch)
tree7d006e7717e2b8e86bdcce3e097b2dc8d8789418 /pkgtools
parent7a8d4629b855e55f49d7c3a067f297c0672946b4 (diff)
downloadpkgsrc-e4fc224719ffbd534203491fd6a913c015230686.tar.gz
Updated pkgchk to 1.10:
Fix -B on some systems, and implement '-k' (similar to make's usage)
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkgchk/Makefile4
-rw-r--r--pkgtools/pkgchk/files/pkgchk.86
-rwxr-xr-xpkgtools/pkgchk/files/pkgchk.sh38
3 files changed, 33 insertions, 15 deletions
diff --git a/pkgtools/pkgchk/Makefile b/pkgtools/pkgchk/Makefile
index a456c42d27c..416c6adbbdf 100644
--- a/pkgtools/pkgchk/Makefile
+++ b/pkgtools/pkgchk/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.10 2001/08/10 11:05:55 abs Exp $
+# $NetBSD: Makefile,v 1.11 2001/08/23 11:55:16 abs Exp $
-DISTNAME= pkgchk-1.09
+DISTNAME= pkgchk-1.10
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkgchk/files/pkgchk.8 b/pkgtools/pkgchk/files/pkgchk.8
index 377cb218b3d..3ae7e860713 100644
--- a/pkgtools/pkgchk/files/pkgchk.8
+++ b/pkgtools/pkgchk/files/pkgchk.8
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkgchk.8,v 1.4 2001/07/31 17:32:07 tron Exp $
+.\" $NetBSD: pkgchk.8,v 1.5 2001/08/23 11:55:17 abs 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 abchinsuvB
+.Op Fl abchiknsuvB
.Op Fl D Ar tags
.Op Fl U Ar tags
.Sh DESCRIPTION
@@ -58,6 +58,8 @@ Check versions of packages specified in pkgchk.conf.
Brief help.
.It Fl i
Check versions of installed packages, ignoring pkgchk.conf.
+.It Fl k
+Continue with further packages if errors are encountered.
.It Fl n
Display actions that would be taken, but do not change anything.
.It Fl s
diff --git a/pkgtools/pkgchk/files/pkgchk.sh b/pkgtools/pkgchk/files/pkgchk.sh
index 5f23238c86b..2b7fb94e45e 100755
--- a/pkgtools/pkgchk/files/pkgchk.sh
+++ b/pkgtools/pkgchk/files/pkgchk.sh
@@ -1,12 +1,17 @@
#!/bin/sh -e
#
-# $Id: pkgchk.sh,v 1.11 2001/08/10 11:05:55 abs Exp $
+# $Id: pkgchk.sh,v 1.12 2001/08/23 11:55:17 abs Exp $
#
# TODO: Handle and as well as or tags (eg: i386+x11)
# TODO: Handle updates with dependencies via binary packages
PATH=/usr/sbin:${PATH}
+echo_n()
+ {
+ echo $ac_n "$*"$ac_c
+ }
+
extract_variables()
{
# Establish PKGSRCDIR
@@ -46,6 +51,7 @@ pkg_install()
PKGNAME=$1
PKGDIR=$2
INSTALL=$3
+
if [ -d /var/db/pkg/$PKGNAME ];then
echo "$PKGNAME installed in previous stage"
elif [ -n "$opt_b" -a -f $PACKAGES/All/$PKGNAME.tgz ] ; then
@@ -63,13 +69,21 @@ pkg_install()
fi
echo "pkg_add $PKGNAME.tgz"
if [ -z "$opt_n" ];then
- pkg_add $PACKAGES/All/$PKGNAME.tgz
+ if [ -n "$opt_k" ]; then
+ pkg_add $PACKAGES/All/$PKGNAME.tgz || true
+ else
+ pkg_add $PACKAGES/All/$PKGNAME.tgz
+ fi
fi
elif [ -n "$opt_s" ]; then
echo "make update for $PKGNAME"
cd $PKGSRCDIR/$PKGDIR
if [ -z "$opt_n" ];then
- ${MAKE} update
+ if [ -n "$opt_k" ]; then
+ ${MAKE} update || true
+ else
+ ${MAKE} update
+ fi
fi
fi
}
@@ -106,14 +120,14 @@ get_build_version()
${GREP} '\$NetBSD' $files | ${SED} -e "s|^${real_pkgsrcdir}/||"
}
-args=`getopt BD:U:abchinsuv $*`
+args=`getopt BD:U:abchiknsuv $*`
if [ $? != 0 ]; then
opt_h=1
fi
set -- $args
while [ $# != 0 ]; do
case "$1" in
- -B ) opt_B=1 ;;
+ -B ) opt_B=1 ; opt_i=1 ;;
-D ) opt_D="$2" ; shift;;
-U ) opt_U="$2" ; shift;;
-a ) opt_a=1 ; opt_c=1 ;;
@@ -121,6 +135,7 @@ while [ $# != 0 ]; do
-c ) opt_c=1 ;;
-h ) opt_h=1 ;;
-i ) opt_i=1 ;;
+ -k ) opt_k=1 ;;
-n ) opt_n=1 ;;
-s ) opt_s=1 ;;
-u ) opt_u=1 ; opt_i=1 ;;
@@ -142,7 +157,7 @@ fi
if [ -n "$opt_h" -o $# != 1 ];then
echo 'Usage: pkgchk [opts]
- -B Check the "Build version" of packages
+ -B Check the "Build version" of packages (implies -i)
-D tags Comma separated list of additional pkgchk.conf tags to set
-U tags Comma separated list of pkgchk.conf tags to unset
-a Add all missing packages (implies -c)
@@ -150,6 +165,7 @@ if [ -n "$opt_h" -o $# != 1 ];then
-c Check installed packages against pkgchk.conf
-h This help
-i Check versions of installed packages (not using pkgchk.conf)
+ -k Continue with further packages if errors are encountered
-n Display actions that would be taken, but do not perform them
-s Limit installations to building from source
-u Update all mismatched packages (implies -i)
@@ -270,29 +286,29 @@ for pkgdir in $PKGDIRLIST ; do
exit 1
fi
if [ ! -d /var/db/pkg/$pkgname ];then
- echo $ac_n "$pkgname: $ac_c"
+ echo_n "$pkgname: "
pkg=`echo $pkgname | sed 's/-[0-9].*//'`
pkginstalled=`pkg_info -e $pkg || true`
INSTALL=
if [ -n "$pkginstalled" ];then
- echo $ac_n "version mismatch - $pkginstalled$ac_c"
+ echo_n "version mismatch - $pkginstalled"
if [ -n "$opt_u" ]; then
UPDATE_TODO="$UPDATE_TODO $pkgname $pkgdir"
fi
else
- echo $ac_n "missing$ac_c"
+ echo_n "missing"
if [ -n "$opt_a" ] ; then
INSTALL_TODO="$INSTALL_TODO $pkgname $pkgdir"
fi
fi
if [ -f $PACKAGES/All/$pkgname.tgz ] ;then
- echo $ac_n " (binary package available)$ac_c"
+ echo_n " (binary package available)"
fi
echo
else
if [ -n "$opt_B" ];then
current_build_version=`get_build_version`
- installed_build_version=`cat /var/db/pkg/$pkgname/+BUILD_VERSION`
+ installed_build_version=`cat /var/db/pkg/$pkgname/+BUILD_VERSION | sed "s:^${real_pkgsrcdir}/::"`
if [ x"$current_build_version" != x"$installed_build_version" ];then
echo "$pkgname: build version information mismatch"
# should we mark this pkg to be updated if -u is given ??