#!/bin/bash # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/ldd-fix.sh,v 1.2 2005-06-03 16:41:48 niro Exp $ if [ -z "$1" ] then echo "$(basename $0) /path/to" exit 1 fi PACKAGES_TO_CHECK="" echo "Checking all files for dynamic link issues ... this may take a while ..." for file in $(find $1 -mount -type f) do if [ -x ${file} -a ! -L ${file} ] then i=$(ldd ${file} | grep 'not found') if [ -n "${i}" ] then #echo " ${file} fix me" x=$(grep -irl ${file} /var/db/mage/*) #echo DEBUG:$x if [ -n "${x}" ] then for pkg in ${x} do k=$(basename $(dirname ${pkg})) if [ -z "$(echo ${PACKAGES_TO_CHECK} | grep ${k})" ] then PACKAGES_TO_CHECK="${PACKAGES_TO_CHECK} ${k}" fi done else "no packages found for ${file}" fi fi fi done #output for i in ${PACKAGES_TO_CHECK} do echo " ${i}" done