summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authoragc <agc>2003-10-04 21:07:53 +0000
committeragc <agc>2003-10-04 21:07:53 +0000
commita423a058bf3490c99e298121de3004a8b1f828b9 (patch)
treeedd97897c68d4e5607592e86a94425bf48dcf3ac /pkgtools
parentbb7fb5ae0f2feb57c483024ec5d5c0ddd7b78a2d (diff)
downloadpkgsrc-a423a058bf3490c99e298121de3004a8b1f828b9.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.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkgchk/Makefile4
-rw-r--r--pkgtools/pkgchk/files/pkgchk.86
-rwxr-xr-xpkgtools/pkgchk/files/pkgchk.sh17
3 files changed, 20 insertions, 7 deletions
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