diff options
author | Gerald Pfeifer <gerald@FreeBSD.org> | 2007-09-08 16:23:13 +0000 |
---|---|---|
committer | Gerald Pfeifer <gerald@FreeBSD.org> | 2007-09-08 16:23:13 +0000 |
commit | df787b975d5f7e7d0c1679f1100f925eb098e23f (patch) | |
tree | fcf8a9dfc321a136bf3b045137532f05ac72ef1c /Tools/scripts/resolveportsfromlibs.sh | |
parent | 1536e7305016a4171ec441e9eb305ab35a6661c0 (diff) |
Notes
Diffstat (limited to 'Tools/scripts/resolveportsfromlibs.sh')
-rwxr-xr-x | Tools/scripts/resolveportsfromlibs.sh | 18 |
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 |