config/functions: add get_build_dir()

This commit is contained in:
Stefan Saraev 2013-12-13 13:18:38 +02:00
parent d8a9d54f3d
commit 8d5c4b91f9

View File

@ -65,6 +65,20 @@ kernel_path() {
echo $ROOT/$BUILD/${PKG_NAME}-${PKG_VERSION}
}
# get package's build dir
get_build_dir() {
if [ ! -z $1 ] ; then
local _PKG_DIR=$(find $ROOT/packages -name $1)
if [ -d $_PKG_DIR -a -f $_PKG_DIR/package.mk ] ; then
. $_PKG_DIR/package.mk
# TODO: remove
elif [ -d $_PKG_DIR -a -f $_PKG_DIR/meta ] ; then
. $_PKG_DIR/meta
fi
echo $ROOT/$BUILD/${PKG_NAME}-${PKG_VERSION}
fi
}
tolower(){
echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
}