summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/CHANGES3
-rw-r--r--pkgtools/pkg_chk/Makefile8
-rwxr-xr-xpkgtools/pkg_chk/files/pkg_chk.sh47
3 files changed, 36 insertions, 22 deletions
diff --git a/doc/CHANGES b/doc/CHANGES
index 6a24e820d32..7dff79ca220 100644
--- a/doc/CHANGES
+++ b/doc/CHANGES
@@ -1,4 +1,4 @@
-$NetBSD: CHANGES,v 1.10790 2005/08/04 15:24:35 adam Exp $
+$NetBSD: CHANGES,v 1.10791 2005/08/04 17:56:36 abs Exp $
Changes to the packages collection and infrastructure in 2005:
@@ -3545,3 +3545,4 @@ Changes to the packages collection and infrastructure in 2005:
Updated net/skype to 1.2.0.11 [xtraeme 2005-08-04]
Updated archivers/unzip to 5.52nb2 [tron 2005-08-04]
Updated mail/msmtp to 1.4.3 [adam 2005-08-04]
+ Updated pkgtools/pkg_chk to 1.60 [abs 2005-08-04]
diff --git a/pkgtools/pkg_chk/Makefile b/pkgtools/pkg_chk/Makefile
index c7fe3d79389..60890e64cb6 100644
--- a/pkgtools/pkg_chk/Makefile
+++ b/pkgtools/pkg_chk/Makefile
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.17 2005/06/01 14:14:47 abs Exp $
+# $NetBSD: Makefile,v 1.18 2005/08/04 17:55:51 abs Exp $
-DISTNAME= pkg_chk-1.59
+DISTNAME= pkg_chk-1.60
CATEGORIES= pkgtools
MASTER_SITES= # empty
DISTFILES= # empty
@@ -29,9 +29,13 @@ do-build:
-e 's#@GREP@#${GREP}#g' \
-e 's#@MAKE@#${MAKE}#g' \
-e 's#@MAKECONF@#${MAKECONF}#g' \
+ -e 's#@PKG_ADD@#${PKG_ADD}#g' \
+ -e 's#@PKG_DELETE@#${PKG_DELETE}#g' \
-e 's#@PKG_INFO@#${PKG_INFO}#g' \
-e 's#@SED@#${SED}#g' \
-e 's#@SH@#${SH}#g' \
+ -e 's#@SORT@#${SORT}#g' \
+ -e 's#@TSORT@#${TSORT}#g' \
${FILESDIR}/pkg_chk.sh >${WRKSRC}/pkg_chk.sh
do-install:
diff --git a/pkgtools/pkg_chk/files/pkg_chk.sh b/pkgtools/pkg_chk/files/pkg_chk.sh
index 39176f90168..1c2f0b84c3b 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.16 2005/06/01 14:14:47 abs Exp $
+# $Id: pkg_chk.sh,v 1.17 2005/08/04 17:55:51 abs Exp $
#
# TODO: Make -g check dependencies and tsort
# TODO: Variation of -g which only lists top level packages
@@ -87,16 +87,13 @@ extract_make_vars()
# $1 = name of variable
# $2 = default value
-extract_mk_dir_var()
+extract_mk_var()
{
if [ -z "`eval echo \\$$1`" ] ; then
eval $(printf "BSD_PKG_MK=1\n.PHONY: x\nx:\n\t@echo $1="'$'"{$1}\n" | ${MAKE} -f - -f $MAKECONF x)
if [ -z "`eval echo \\$$1`" ]; then
eval "$1=$2"
fi
- if [ ! -d `eval echo \\$$1` ];then
- fatal "Unable to locate $1 `eval echo \\$$1`"
- fi
fi
}
@@ -130,8 +127,14 @@ extract_pkg_vars()
extract_variables()
{
- extract_mk_dir_var PKGSRCDIR /usr/pkgsrc
- extract_mk_dir_var PKG_DBDIR /var/db/pkg
+ extract_mk_var PKGSRCDIR /usr/pkgsrc
+ if [ ! -d $PKGSRCDIR -a ! $opt_b ] ; then
+ fatal "Unable to locate PKGSRCDIR ($PKGSRCDIR)"
+ fi
+ extract_mk_var PKG_DBDIR /var/db/pkg
+ if [ ! -d $PKG_DBDIR ] ; then
+ fatal "Unable to locate PKG_DBDIR ($PKG_DBDIR)"
+ fi
# Now we have PKGSRCDIR, use it to determine PACKAGES, and PKGCHK_CONF
# as well as AWK, GREP, SED, PKGCHK_TAGS and PKGCHK_NOTAGS
@@ -278,7 +281,14 @@ pkgdirs_from_conf()
# Determine list of tags
#
- extract_make_vars Makefile OPSYS OS_VERSION MACHINE_ARCH
+ if [ $PKGSRCDIR = NONE ]; then
+ OPSYS=$(uname -s)
+ OS_VERSION=$(uname -r)
+ MACHINE_ARCH=$(uname -p)
+ else
+ extract_make_vars Makefile OPSYS OS_VERSION MACHINE_ARCH
+ fi
+
TAGS="$(hostname | ${SED} -e 's,\..*,,'),$(hostname),$OPSYS-$OS_VERSION-$MACHINE_ARCH,$OPSYS-$OS_VERSION,$OPSYS-$MACHINE_ARCH,$OPSYS,$OS_VERSION,$MACHINE_ARCH"
if [ -f /usr/X11R6/lib/libX11.so -o -f /usr/X11R6/lib/libX11.a ];then
TAGS="$TAGS,x11"
@@ -566,14 +576,16 @@ fi
saved_PKG_PATH=$PKG_PATH
unset PKG_PATH || true
-test -n "$AWK" || AWK="@AWK@"
-test -n "$GREP" || GREP="@GREP@"
-test -n "$MAKE" || MAKE="@MAKE@"
-test -n "$MAKECONF" || MAKECONF="@MAKECONF@"
-test -n "$PKG_INFO" || PKG_INFO="@PKG_INFO@"
-test -n "$SED" || SED="@SED@"
-test -n "$SORT" || SORT="@SORT@"
-test -n "$TSORT" || TSORT="@TSORT@"
+test -n "$AWK" || AWK="@AWK@"
+test -n "$GREP" || GREP="@GREP@"
+test -n "$MAKE" || MAKE="@MAKE@"
+test -n "$MAKECONF" || MAKECONF="@MAKECONF@"
+test -n "$PKG_ADD" || PKG_ADD="@PKG_ADD@"
+test -n "$PKG_DELETE" || PKG_DELETE="@PKG_DELETE@"
+test -n "$PKG_INFO" || PKG_INFO="@PKG_INFO@"
+test -n "$SED" || SED="@SED@"
+test -n "$SORT" || SORT="@SORT@"
+test -n "$TSORT" || TSORT="@TSORT@"
if [ ! -f $MAKECONF ] ; then
if [ -f /etc/mk.conf ] ; then
@@ -637,9 +649,6 @@ if [ -n "$opt_b" -a -z "$opt_s" -a -d $PACKAGES ] ; then
done
fi
-cd $PKGSRCDIR
-real_pkgsrcdir=$(pwd)
-
if [ -n "$opt_g" ]; then
verbose "Write $PKGCHK_CONF based on installed packages"
generate_conf_from_installed $PKGCHK_CONF