config/functions: allow package to be sourced using path

This commit is contained in:
MilhouseVH 2019-02-08 17:17:43 +00:00
parent fb7bfa02f9
commit 2e3ac4899f

View File

@ -857,7 +857,7 @@ source_package() {
unset_functions
if [ -n "${1}" ]; then
PKG_DIR="$(get_pkg_directory ${1})"
[ -f "${1}" ] && PKG_DIR="$(dirname "${1}")" || PKG_DIR="$(get_pkg_directory "${1}")"
[ -n "$PKG_DIR" -a -r $PKG_DIR/package.mk ] || die "FAILURE: unable to source package - ${1}/package.mk does not exist"