1 |
#!/bin/bash |
#!/bin/bash |
2 |
# $Id$ |
# $Id$ |
3 |
|
|
4 |
if [ -z "$1" ] |
if [ -z "$@" ] |
5 |
then |
then |
6 |
echo "$(basename $0) /path/to" |
echo "$(basename $0) /path/to" |
7 |
exit 1 |
exit 1 |
13 |
export LC_ALL=C |
export LC_ALL=C |
14 |
|
|
15 |
echo "Checking all files for dynamic link issues ... this may take a while ..." |
echo "Checking all files for dynamic link issues ... this may take a while ..." |
16 |
for file in $(find $1 -mount -type f) |
for file in $(find $@ -mount -type f) |
17 |
do |
do |
18 |
if [ -x ${file} -a ! -L ${file} ] |
if [ -x ${file} -a ! -L ${file} ] |
19 |
then |
then |
20 |
i=$(ldd ${file} | grep 'not found') |
i=$(ldd ${file} | grep 'not found') |
21 |
if [ -n "${i}" ] |
if [ -n "${i}" ] |
22 |
then |
then |
23 |
x=$(grep -irl ${file}§ /var/db/mage/*) |
x=$(magequery -e ${file}) |
24 |
#echo DEBUG:$x |
#echo DEBUG:$x |
25 |
if [ -n "${x}" ] |
if [ -n "${x}" ] |
26 |
then |
then |
27 |
for pkg in ${x} |
for pkg in ${x} |
28 |
do |
do |
29 |
k=$(basename $(dirname ${pkg})) |
k="${pkg}" |
30 |
if [ -z "$(echo ${PACKAGES_TO_CHECK} | grep ${k})" ] |
if [ -z "$(echo ${PACKAGES_TO_CHECK} | grep ${k})" ] |
31 |
then |
then |
32 |
PACKAGES_TO_CHECK="${PACKAGES_TO_CHECK} ${k}" |
PACKAGES_TO_CHECK="${PACKAGES_TO_CHECK} ${k}" |