From 5d8bdc6b05cb31faedc0161de1842af266d84cdd Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Tue, 28 May 2013 15:07:25 +0200 Subject: beauty operations :) --- helper/binutil.inc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'helper') diff --git a/helper/binutil.inc b/helper/binutil.inc index 607041f0..261ccf16 100644 --- a/helper/binutil.inc +++ b/helper/binutil.inc @@ -39,8 +39,8 @@ get_dynamic_dependencies() { for LIB in $(cat $LDD_OUT | grep -v "${CURRENT_BLACKLIST}" | awk '{print $1 $2 $3}'); do # split the entry into an array, ex: # libm.so.6 => /lib/libm.so.6 would be split into: - # liblink[0] liblink[1] - local liblink=(${LIB//=>/ }) + # LIBLINK[0] LIBLINK[1] + local LIBLINK=(${LIB//=>/ }) lib_search done else @@ -59,13 +59,13 @@ lib_search(){ # if activated, start by searching the lib locally if [ "x$LOCALSEARCH" == "x1" ]; then cd $LOCALSEARCHDIR - local LOCAL_MATCHES=$(find . -name "${liblink[0]}") # | awk -F '.' '{print $1}')".so\*) + local LOCAL_MATCHES=$(find . -name "${LIBLINK[0]}") # | awk -F '.' '{print $1}')".so\*) cd - &>/dev/null if [ "x${LOCAL_MATCHES}" != "x" ]; then - for llib in ${LOCAL_MATCHES}; do - get_link_chain "${LOCALSEARCHDIR}"/"${llib}" "${LOCALSEARCHDIR}" - get_dynamic_dependencies -l "${LOCALSEARCHDIR}" "${llib}" - CURRENT_BLACKLIST+="\|${liblink[0]}" + for LOCALLIB in ${LOCAL_MATCHES}; do + get_link_chain "${LOCALSEARCHDIR}"/"${LOCALLIB}" "${LOCALSEARCHDIR}" + get_dynamic_dependencies -l "${LOCALSEARCHDIR}" "${LOCALLIB}" + CURRENT_BLACKLIST+="\|${LIBLINK[0]}" done # found the libs, we are done return @@ -74,12 +74,12 @@ lib_search(){ fi # search the lib on the system since it was not found earlier - if [ ! -z ${liblink[1]} ] && [ "x${liblink[1]}" != "xnot" ]; then + if [ ! -z ${LIBLINK[1]} ] && [ "x${LIBLINK[1]}" != "xnot" ]; then # get chain of symlink for that lib - get_link_chain ${liblink[1]} - CURRENT_BLACKLIST+="\|${liblink[1]}" + get_link_chain "${LIBLINK[1]}" + CURRENT_BLACKLIST+="\|${LIBLINK[1]}" else - pwarning "\t\tLib '${liblink[0]}' from required dir '$ENTRY' neither found in build directory nor on this system." + pwarning "\t\tLib '${LIBLINK[0]}' from required dir '$ENTRY' neither found in build directory nor on this system." pwarning "\t\tIf this lib is not supplied by another module, this module will probably fail in your final system" fi } @@ -130,13 +130,13 @@ get_link_chain() { # now we check for symlinks local TRY=0 - while [ -L $LINK ] && [ $TRY -lt 10 ]; do + while [ -L "$LINK" ] && [ $TRY -lt 10 ]; do let TRY=TRY+1 # save the directory prefix - CURRENTDIR=$(dirname ${LINK}) + CURRENTDIR=$(dirname "${LINK}") # first follow the link - LINK=$(readlink $LINK) + LINK=$(readlink "$LINK") CHAIN+=" -> $LINK" # $LINK can be absolute or relative, check cases [[ "$LINK" == /* ]] || LINK=$(canonicalize "$CURRENTDIR"/"${LINK}") -- cgit v1.2.3-55-g7522