path: fix folders returned by find command

redirect errors in function get_build_dir()
This commit is contained in:
vpeter4 2014-09-28 10:53:20 +02:00
parent 2c54f9a757
commit 2cedaafbe4
2 changed files with 4 additions and 4 deletions

View File

@ -82,11 +82,11 @@ get_module_dir() {
# get package's build dir
get_build_dir() {
if [ ! -z $1 ] ; then
local _PKG_DIR=$(find $ROOT/projects/$PROJECT/packages -name $1)
local _PKG_DIR=$(find $ROOT/projects/$PROJECT/packages -name $1 2>/dev/null)
if [ -d "$_PKG_DIR" -a -f $_PKG_DIR/package.mk ] ; then
. $_PKG_DIR/package.mk
else
local _PKG_DIR=$(find $ROOT/packages -name $1)
local _PKG_DIR=$(find $ROOT/packages -name $1 2>/dev/null)
if [ -d "$_PKG_DIR" -a -f $_PKG_DIR/package.mk ] ; then
. $_PKG_DIR/package.mk
fi

View File

@ -69,7 +69,7 @@ SED="sed -i"
# first check project folder for a package
FOUND=0
ALL_DIRS=""
for DIR in $ROOT/`find projects/$PROJECT/packages -type d -name $_PKG_ROOT_NAME ! -wholename \*\/source\/\* 2>/dev/null` ; do
for DIR in `find $ROOT/projects/$PROJECT/packages -type d -name $_PKG_ROOT_NAME ! -wholename \*\/source\/\* 2>/dev/null` ; do
# keep track of dirs with meta for debugging
if [ -z "$ALL_DIRS" ] ; then
ALL_DIRS="$DIR"
@ -93,7 +93,7 @@ SED="sed -i"
if [ $FOUND -eq 0 ] ; then
FOUND=0
ALL_DIRS=""
for DIR in $ROOT/`find $PACKAGES -type d -name $_PKG_ROOT_NAME ! -wholename \*\/source\/\* 2>/dev/null` ; do
for DIR in `find $ROOT/$PACKAGES -type d -name $_PKG_ROOT_NAME ! -wholename \*\/source\/\* 2>/dev/null` ; do
# keep track of dirs with meta for debugging
if [ -z "$ALL_DIRS" ] ; then
ALL_DIRS="$DIR"