#! /bin/sh
########################################################################
# pkgpath - shell script to return a SoftRelTools package's physical path
#   handles three cases:
#   1) local release, addpkg or lnkpkg done of <pkg>: returns local directory
#   2) local release, no addpkg or lnkpkg: returns release directory
#   3) production release, returns release directory
#
#   input:  path to the top level build directory,
#             usually passed as a variable from some toplevel
#             makefile.
#           package name
#   output: full path to package, to stdout
#
#   author: AMJonckheere, 3/18/98
########################################################################

if [ "$#" -ne 2 ]; then
  echo "Must input the starting directory and package name"
  exit 2
fi

if [ -d $1/$2 ]; then
  echo $1/$2
elif [ -d $BFDIST/releases/$BFCURRENT/$2 ]; then
  echo $BFDIST/releases/$BFCURRENT/$2
else
  echo "$1/$2/ not found"
  exit 2
fi

