aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorGerald Pfeifer <gerald@FreeBSD.org>2007-09-08 16:23:13 +0000
committerGerald Pfeifer <gerald@FreeBSD.org>2007-09-08 16:23:13 +0000
commitdf787b975d5f7e7d0c1679f1100f925eb098e23f (patch)
treefcf8a9dfc321a136bf3b045137532f05ac72ef1c /Tools
parent1536e7305016a4171ec441e9eb305ab35a6661c0 (diff)
downloadports-df787b975d5f7e7d0c1679f1100f925eb098e23f.tar.gz
ports-df787b975d5f7e7d0c1679f1100f925eb098e23f.zip
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/resolveportsfromlibs.sh18
1 files changed, 15 insertions, 3 deletions
diff --git a/Tools/scripts/resolveportsfromlibs.sh b/Tools/scripts/resolveportsfromlibs.sh
index ed207aebfae6..b88a61186a13 100755
--- a/Tools/scripts/resolveportsfromlibs.sh
+++ b/Tools/scripts/resolveportsfromlibs.sh
@@ -81,9 +81,21 @@ if [ -z "${PORTSDIR}" ]; then
PORTSDIR=$(make -f /etc/make.conf -V PORTSDIR)
fi
-if [ -z "${PORTSDIR}" -o ! -d "${PORTSDIR}" ]; then
+if [ -z "${PORTSDIR}" ]; then
PORTSDIR=/usr/ports
fi
+if [ ! -d "${PORTSDIR}" ]; then
+ echo "PORTSDIR = ${PORTSDIR} is not a directory."
+ exit 1
+fi
+
+if [ -z "${PKG_DBDIR}" ]; then
+ PKG_DBDIR=/var/db/pkg
+fi
+if [ ! -d "${PKG_DBDIR}" ]; then
+ echo "PKG_DBDIR = ${PKG_DBDIR} is not a directory."
+ exit 1
+fi
for i in $@; do
result=""
@@ -112,9 +124,9 @@ for i in $@; do
for base in ${bases}; do
port=$(pkg_which "${base}/lib/$i")
- if [ -f /var/db/pkg/$port/+CONTENTS ]; then
+ if [ -f $PKG_DBDIR/$port/+CONTENTS ]; then
origin=$(grep "@comment ORIGIN:" \
- /var/db/pkg/$port/+CONTENTS \
+ $PKG_DBDIR/$port/+CONTENTS \
| sed -e 's/@comment ORIGIN://')
break
else