summaryrefslogtreecommitdiffstats
path: root/remote/setup_tools
diff options
context:
space:
mode:
authorSimon Rettberg2013-02-25 18:07:40 +0100
committerSimon Rettberg2013-02-25 18:07:40 +0100
commit6115aa3769390404c3f03f29b4006fa2be212b66 (patch)
treed8857ef05ebc149d9e44c4688f3c751a78c77a59 /remote/setup_tools
parentbinutil external binary functions (diff)
downloadtm-scripts-6115aa3769390404c3f03f29b4006fa2be212b66.tar.gz
tm-scripts-6115aa3769390404c3f03f29b4006fa2be212b66.tar.xz
tm-scripts-6115aa3769390404c3f03f29b4006fa2be212b66.zip
[tools] replace locate by find in base.build as it is faster, [setup_tools] treat scripts as binaries too but skip ldd part
Diffstat (limited to 'remote/setup_tools')
-rwxr-xr-xremote/setup_tools8
1 files changed, 4 insertions, 4 deletions
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