#!/bin/bash # $Id$ #scanelf 0.7 has a bug, it ignores the first element in the path PATH="/lala:${PATH}" SCANELF="scanelf -yRBqN" SONAME="$1" BINDIR="$2" if [[ -z ${SONAME} ]] then echo "No soname given!" exit 1 fi if [[ -z ${BINDIR} ]] then # use scanelf opts to scan everything in path/ldpath BINDIR="-p -l" fi build_filename_list() { FILENAME_LIST="$(${SCANELF} ${SONAME} ${BINDIR} | cut -d' ' -f3 | sort -u)" export FILENAME_LIST } build_depname_list() { local file local deps local i for file in ${FILENAME_LIST} do # search exact filenames! deps+=" $(magequery -e ${file})" done DEPNAME_LIST="$(for i in ${deps}; do echo ${i}; done | sort -u)" export DEPNAME_LIST } build_filename_list #echo "${FILENAME_LIST}" build_depname_list echo "${DEPNAME_LIST}"