From 6115aa3769390404c3f03f29b4006fa2be212b66 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 25 Feb 2013 18:07:40 +0100 Subject: [tools] replace locate by find in base.build as it is faster, [setup_tools] treat scripts as binaries too but skip ldd part --- remote/setup_tools | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'remote/setup_tools') diff --git a/remote/setup_tools b/remote/setup_tools index 76f163f5..2df84a5d 100755 --- a/remote/setup_tools +++ b/remote/setup_tools @@ -47,7 +47,7 @@ copyfileswithdependencies () [ ! -z "${REQUIRED_BINARIES}" ] && pinfo "Gathering required binaries from config file..." for FILENAME in ${REQUIRED_BINARIES} do - FILE=$(find . -name ${FILENAME} -type f -executable | xargs grep -l '^.ELF') # FIXME: What happens on multiple matches? Maybe add " | head -1" + FILE=$(find . -name "${FILENAME}" -type f -executable | xargs grep -l -E '^(.ELF|#!)' | head -1) if [ -z "$FILE" ]; then pwarning "\tNo Binary found for ${FILENAME}. Skipping." continue @@ -57,8 +57,8 @@ copyfileswithdependencies () # fetch dependencies # quick fix to exclude libc*, else it copies unneeded libs... # workaround for - ldd ${FILE} &>/dev/null - ldd_exit_code=$? + ldd "${FILE}" &>/dev/null + local ldd_exit_code=$? if [ "x$ldd_exit_code" != "x0" ]; then pdebug "\tldd $FILE failed." @@ -67,7 +67,7 @@ copyfileswithdependencies () for i in $(ldd "${FILE}" | awk '{print $1 $2 $3}' | grep -v ld-linux | grep -v libc.so | grep -v linux-gate | grep -v linux-vdso) do arrIN=(${i//=>/ }) - pdebug "* ${arrIN[0]}" + pdebug "Processing lib ${arrIN[0]}" LOCAL_MATCHES=$(find . -name "$(echo ${arrIN[0]} | awk -F '.' '{print $1}')".so\*) if [ "x${LOCAL_MATCHES}" != "x" ]; then -- cgit v1.2.3-55-g7522