summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorabs <abs>2005-08-04 17:55:51 +0000
committerabs <abs>2005-08-04 17:55:51 +0000
commit8636cc0ef3294b12e31191a45411324316bce4f6 (patch)
tree6bc5bfb610172527e9f1e6770ec30f57a1cbcce3 /pkgtools
parent381c31577326f6b4a430a058800cf7bb6ae4af4f (diff)
downloadpkgsrc-8636cc0ef3294b12e31191a45411324316bce4f6.tar.gz
update pkgtools/pkg_chk to 1.60:
Make -b work without any access to pkgsrcdir
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_chk/Makefile8
-rwxr-xr-xpkgtools/pkg_chk/files/pkg_chk.sh47
2 files changed, 34 insertions, 21 deletions
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