Blame util/scan-for-dep.sh

3af8db
#!/bin/bash
3af8db
3af8db
SCAN_PATH=$1
3af8db
DEP=$2
3af8db
3af8db
SCAN_PATH=$(cd "$SCAN_PATH"; pwd)
3af8db
3af8db
run() {
3af8db
    local SCAN_PATH=$1
3af8db
    cd "$SCAN_PATH"
3af8db
    for FILE in $SCAN_PATH/*; do
3af8db
        if [ -f "$FILE" ]; then
3af8db
            if [[ $FILE == *.so* ]] || [[ $FILE == */bin/* ]]; then
3af8db
                FILE_DEPS=`ldd "$FILE" | grep "$DEP"`
3af8db
                if [ ! -z "$FILE_DEPS" ]; then
3af8db
                    echo $FILE
3af8db
                fi
3af8db
            fi
3af8db
        elif [ -d "$FILE" ]; then
3af8db
            run $FILE
3af8db
        fi
3af8db
    done
3af8db
}
3af8db
3af8db
run "$SCAN_PATH"