summaryrefslogtreecommitdiffstats
path: root/helper/binutil.inc
diff options
context:
space:
mode:
authorJonathan Bauer2013-06-11 15:23:46 +0200
committerJonathan Bauer2013-06-11 15:23:46 +0200
commit98bf712732bf23ee66cd97bb458863e3ff0b2f2f (patch)
tree7792fdf4a5ced5d86fa22df58681fd5f41e967f7 /helper/binutil.inc
parent[pam] register login session at systemd-logind service (diff)
parent[vmplayer] clean up run-virt.include: drop support for old player versions (diff)
downloadtm-scripts-98bf712732bf23ee66cd97bb458863e3ff0b2f2f.tar.gz
tm-scripts-98bf712732bf23ee66cd97bb458863e3ff0b2f2f.tar.xz
tm-scripts-98bf712732bf23ee66cd97bb458863e3ff0b2f2f.zip
Merge branch 'master' of git:openslx-ng/tm-scripts
Diffstat (limited to 'helper/binutil.inc')
-rw-r--r--helper/binutil.inc24
1 files changed, 12 insertions, 12 deletions
diff --git a/helper/binutil.inc b/helper/binutil.inc
index 72a43ad2..497ae75b 100644
--- a/helper/binutil.inc
+++ b/helper/binutil.inc
@@ -18,7 +18,7 @@
#
############################################################
# We use a blacklist mechanism to exclude common libraries.
-# This improve runtime quite a bit...
+# This improves runtime quite a bit...
BLACKLIST="ld-linux linux-gate linux-vdso libc.so"
# Initialise flag and path for local search
@@ -45,21 +45,21 @@ get_dynamic_dependencies() {
if [ "x$1" == "x-l" ]; then
LOCALSEARCH=1
shift
- [ ! -d $1 ] && perror "Directory given does not exist, exiting."
- LOCALSEARCHDIR=$1
+ [ ! -d "$1" ] && perror "Directory '$1' does not exist, exiting."
+ LOCALSEARCHDIR="$1"
shift
fi
# main loop over the list of binaries
while [ $# != 0 ]; do
- local BINARY=$1
+ local BINARY="$1"
shift
# now run ldd on it and save the output in $LDD_OUT
local LDD_OUT="ldd_output"
- if ldd $BINARY > $LDD_OUT; then
+ if ldd "$BINARY" > "$LDD_OUT"; then
# Case 1: file is a dynamic executable
- for LIB in $(cat $LDD_OUT | grep -v "${CURRENT_BLACKLIST}" | awk '{print $1 $2 $3}'); do
+ for LIB in $(grep -v "${CURRENT_BLACKLIST}${REQUIRED_LDD_BLACKLIST}" "$LDD_OUT" | 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]
@@ -70,10 +70,10 @@ get_dynamic_dependencies() {
else
# Case 2: not a dynamic, do nothing
pdebug "\t\t\t(Not a dynamic.)"
- rm -f $LDD_OUT
+ rm -f "$LDD_OUT"
continue
fi
- rm -f $LDD_OUT
+ rm -f "$LDD_OUT"
done
}
@@ -92,16 +92,16 @@ get_dynamic_dependencies() {
# If the local was activated in get_dynamic_dependencies
# this will search for the library in LOCALSEARCHDIR first.
# If its not found, then it will look system-wide.
-lib_search(){
+lib_search() {
# if activated, start by searching the lib locally
if [ "x$LOCALSEARCH" == "x1" ]; then
- cd $LOCALSEARCHDIR
+ cd "$LOCALSEARCHDIR"
local LOCAL_MATCHES=$(find . -name "${LIBLINK[0]}") # | awk -F '.' '{print $1}')".so\*)
- cd - &>/dev/null
+ cd - >/dev/null
if [ "x${LOCAL_MATCHES}" != "x" ]; then
for LOCALLIB in ${LOCAL_MATCHES}; do
- get_link_chain "${LOCALSEARCHDIR}"/"${LOCALLIB}" "${LOCALSEARCHDIR}"
+ get_link_chain "${LOCALSEARCHDIR}/${LOCALLIB}" "${LOCALSEARCHDIR}"
get_dynamic_dependencies -l "${LOCALSEARCHDIR}" "${LOCALLIB}"
CURRENT_BLACKLIST+="\|${LIBLINK[0]}"
done