summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2003-10-04 21:07:53 +0000
committeragc <agc@pkgsrc.org>2003-10-04 21:07:53 +0000
commit3e0194d117d9f1fefc12f3edc4e1c23fb7bb8b30 (patch)
treeedd97897c68d4e5607592e86a94425bf48dcf3ac
parent1471438b5b6cb9eb438bd71658fa82a11bde5f4a (diff)
downloadpkgsrc-3e0194d117d9f1fefc12f3edc4e1c23fb7bb8b30.tar.gz
Update pkgchk to 1.44 - add a -g option to generate an initial pkgchk.conf
file based upon the packages currently installed on the host machine.
-rw-r--r--doc/CHANGES3
-rw-r--r--pkgtools/pkgchk/Makefile4
-rw-r--r--pkgtools/pkgchk/files/pkgchk.86
-rwxr-xr-xpkgtools/pkgchk/files/pkgchk.sh17
4 files changed, 22 insertions, 8 deletions
diff --git a/doc/CHANGES b/doc/CHANGES
index 8eb5ee6ffbe..2ad9ab641c4 100644
--- a/doc/CHANGES
+++ b/doc/CHANGES
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES,v 1.3636 2003/10/04 21:02:02 jschauma Exp $
+$NetBSD: CHANGES,v 1.3637 2003/10/04 21:08:46 agc Exp $
Changes to the packages collection and infrastructure in 2003:
@@ -4071,3 +4071,4 @@ Changes to the packages collection and infrastructure in 2003:
Added scm-5d8 [agc 2003-10-04]
Added gpspoint-2.030521 [jschauma 2003-10-04]
Added gpsutils-0.4.0 [jschauma 2003-10-04]
+ Updated pkgchk to 1.44 [agc 2003-10-04]
diff --git a/pkgtools/pkgchk/Makefile b/pkgtools/pkgchk/Makefile
index d747b0bf60e..2ba03044677 100644
--- a/pkgtools/pkgchk/Makefile
+++ b/pkgtools/pkgchk/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.47 2003/10/01 11:30:10 abs Exp $
+# $NetBSD: Makefile,v 1.48 2003/10/04 21:07:53 agc Exp $
-DISTNAME= pkgchk-1.43
+DISTNAME= pkgchk-1.44
WRKSRC= ${WRKDIR}
CATEGORIES= pkgtools
MASTER_SITES= # empty
diff --git a/pkgtools/pkgchk/files/pkgchk.8 b/pkgtools/pkgchk/files/pkgchk.8
index 9f26ec29f7e..d09750ad1f3 100644
--- a/pkgtools/pkgchk/files/pkgchk.8
+++ b/pkgtools/pkgchk/files/pkgchk.8
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkgchk.8,v 1.18 2003/10/04 12:02:12 seb Exp $
+.\" $NetBSD: pkgchk.8,v 1.19 2003/10/04 21:07:53 agc Exp $
.\"
.\" Copyright (c) 2001 by David Brownlee (abs@netbsd.org)
.\" Absolutely no warranty.
@@ -71,6 +71,10 @@ to perform the fetch before any building, or with
or
.Fl i
to just fetch missing/mismatches packages.
+.It Fl g
+Generate an initial
+.Pa pkgchk.conf
+file based upon the packages installed on the host machine.
.It Fl h
Brief help.
.It Fl i
diff --git a/pkgtools/pkgchk/files/pkgchk.sh b/pkgtools/pkgchk/files/pkgchk.sh
index 0f1b65ae68e..a2c6e1678dd 100755
--- a/pkgtools/pkgchk/files/pkgchk.sh
+++ b/pkgtools/pkgchk/files/pkgchk.sh
@@ -1,6 +1,6 @@
#!/bin/sh -e
#
-# $Id: pkgchk.sh,v 1.46 2003/10/01 11:30:10 abs Exp $
+# $Id: pkgchk.sh,v 1.47 2003/10/04 21:07:53 agc Exp $
#
# TODO: Handle updates with dependencies via binary packages
@@ -308,7 +308,7 @@ run_cmd()
fi
}
-args=`getopt BC:D:L:U:abcfhiklnrsuv $*`
+args=`getopt BC:D:L:U:abcfghiklnrsuv $*`
if [ $? != 0 ]; then
opt_h=1
fi
@@ -324,6 +324,7 @@ while [ $# != 0 ]; do
-b ) opt_b=1 ;;
-c ) opt_c=1 ;;
-f ) opt_f=1 ;;
+ -g ) opt_g=1 ;;
-h ) opt_h=1 ;;
-i ) opt_i=1 ;;
-k ) opt_k=1 ;;
@@ -342,8 +343,8 @@ if [ -z "$opt_b" -a -z "$opt_s" ];then
opt_b=1; opt_s=1;
fi
-if [ -z "$opt_a" -a -z "$opt_c" -a -z "$opt_i" -a -z "$opt_l" ];then
- echo "Must specify at least one of -a, -c, -i, -l, or -u";
+if [ -z "$opt_a" -a -z "$opt_c" -a -z "$opt_g" -a -z "$opt_i" -a -z "$opt_l" ];then
+ echo "Must specify at least one of -a, -c, -g, -i, -l, or -u";
echo
opt_h=1;
fi
@@ -359,6 +360,7 @@ if [ -n "$opt_h" -o $# != 1 ];then
-b Limit installations to binary packages
-c Check installed packages against pkgchk.conf
-f Perform a 'make fetch' for all required packages
+ -g Generate an initial pkgchk.conf file
-h This help
-i Check versions of installed packages (not using pkgchk.conf)
-k Continue with further packages if errors are encountered
@@ -420,6 +422,13 @@ if [ -n "$opt_i" ];then
PKGDIRLIST=`sh -c "${PKG_INFO} -B \*" | ${AWK} -F= '/PKGPATH=/{print $2" "}'`
fi
+if [ -n "$opt_g" ]; then
+ if [ -r $PKGCHK_CONF ]; then
+ mv $PKGCHK_CONF ${PKGCHK_CONF}.old
+ fi
+ echo "# Generated automatically at `date`" > $PKGCHK_CONF
+ ${PKG_INFO} -qBa | awk '/^PKGPATH/ { sub("PKGPATH=[ ]*", ""); print }' >> $PKGCHK_CONF
+fi
if [ -n "$opt_c" -o -n "$opt_l" ];then