From fa1c2cf93b27191a77a31fc0fa718f66de2c2956 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 10 Jun 2013 16:13:03 +0200 Subject: [systemd] patch PATH environment variable in systemd-src --- helper/binutil.inc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'helper') diff --git a/helper/binutil.inc b/helper/binutil.inc index 72a43ad2..9ad9e104 100644 --- a/helper/binutil.inc +++ b/helper/binutil.inc @@ -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 $(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] @@ -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 -- cgit v1.2.3-55-g7522