You are not logged in.

#1 2004-08-28 20:25:38

kpiche
Forum Fellow
From: Ottawa, ON, Canada
Registered: 2004-03-30
Posts: 246
Website

script to find missing library references

When readline5 came out I decided to write a quick shell script to find any binary that references readline4.  Then I generalized it:

#!/bin/bash
#  2004/08/22  K. Piche  Find missing library references.
ifs=$IFS
IFS=':'

libdirs="/lib:/usr/lib:/usr/X11R6/lib:/opt/gnome/lib:/opt/qt/lib:/opt/mozilla/lib/mozilla-1.7:/opt/kde/lib"
extras=

#  Check ELF binaries in the PATH and specified dir trees.
for tree in $PATH $libdirs $extras
do
        echo DIR $tree

        #  Get list of files in tree.
        files=$(find $tree -type f)
        IFS=$ifs
        for i in $files
        do
                if [ `file $i | grep -c 'ELF'` -ne 0 ]; then
                        #  Is an ELF binary.
                        if [ `ldd $i 2>/dev/null | grep -c 'not found'` -ne 0 ]; then
                                #  Missing lib.
                                echo "$i:"
                                ldd $i 2>/dev/null | grep 'not found'
                        fi
                fi
        done
done

exit

I successfully used it to find readline4 usage by guile and jack, and other older library references in other packages.  Hope the devs or somebody finds it useful.  And yeah it could pull the lib dirs from ld.so.conf or search the whole system but it is quick and dirty...

PS. Without the /dev/null redirects ldd reports tons of libraries without the exec bit set.  Take it out if you want to see that stuff.

Offline

#2 2004-08-28 20:52:59

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: script to find missing library references

so simple and SOOO USEFULL!!!!!!!

thanx a lot, for this script :-)

i detected also some more trouble:

e.g.:

/usr/bin/xml2ps:
        libgtkmm-2.0.so.1 => not found
        libgdkmm-2.0.so.1 => not found
        libatkmm-1.0.so.1 => not found
        libpangomm-1.0.so.1 => not found
        libglibmm-2.0.so.1 => not found

/usr/bin/passepartout:
        libgtkmm-2.0.so.1 => not found
        libgdkmm-2.0.so.1 => not found
        libatkmm-1.0.so.1 => not found
        libpangomm-1.0.so.1 => not found
        libglibmm-2.0.so.1 => not found


/opt/kde/bin/khangman:
        libknewstuff.so.1 => not found
/opt/kde/bin/kpalmdoc:
        libreadline.so.4 => not found
/opt/kde/bin/kpilot:
        libreadline.so.4 => not found
/opt/kde/bin/kstars:
        libknewstuff.so.1 => not found
/opt/kde/bin/klettres:
        libknewstuff.so.1 => not found
/opt/kde/bin/kpilotDaemon:
        libreadline.so.4 => not found
/opt/kde/bin/korganizer:
        libknewstuff.so.1 => not found
        libknewstuff.so.1 => not found

/opt/gnome/bin/gnome-pilot-make-password:
        libreadline.so.4 => not found
        libreadline.so.4 => not found
        libreadline.so.4 => not found
/opt/gnome/bin/gpilot-install-file:
        libreadline.so.4 => not found
        libreadline.so.4 => not found
        libreadline.so.4 => not found
/opt/gnome/bin/gpilotd-session-wrapper:
        libreadline.so.4 => not found
        libreadline.so.4 => not found
        libreadline.so.4 => not found
/opt/gnome/bin/ssconvert:
        libssl.so.0.9.6 => not found
        libcrypto.so.0.9.6 => not found
/opt/gnome/bin/gnumeric:
        libssl.so.0.9.6 => not found
        libcrypto.so.0.9.6 => not found
/opt/gnome/bin/gpilotd-control-applet:
        libreadline.so.4 => not found
        libreadline.so.4 => not found
        libreadline.so.4 => not found

/usr/lib/xine/plugins/xineplug_inp_dvdnav.so:
        libdvdnav.so.1 => not found
        libdvdread.so.2 => not found
        libxineutils.so.0 => not found
        libxine.so.0 => not found

/usr/lib/ruby/1.8/i686-linux/readline.so:
        libreadline.so.4 => not found

/usr/lib/newpg/gpg-protect-tool:
        libgcrypt.so.1 => not found
/usr/lib/avifile-0.7/xvid.so:
        libxvidcore.so.2 => not found
/usr/lib/libpisock.so.8.0.5:
        libreadline.so.4 => not found

-> for sure broken:
jack, pilot-link, gnumeric, ruby, passepartout, xine-dvdnav,  kde (games, edu, pim, maybe lib and others)

the script is still running - takes long to check 5GB of bins :-)

EDIT: finished - list updated - going to post bugs


The impossible missions are the only ones which succeed.

Offline

#3 2004-08-28 21:30:41

dp
Member
From: Zürich, Switzerland
Registered: 2003-05-27
Posts: 3,378
Website

Re: script to find missing library references

posted bugs 1337 - 1341


The impossible missions are the only ones which succeed.

Offline

#4 2004-08-28 21:38:28

kpiche
Forum Fellow
From: Ottawa, ON, Canada
Registered: 2004-03-30
Posts: 246
Website

Re: script to find missing library references

Glad you like it!  Hopefully someone with ALL packages installed can run it...

I thought of adding a missing library check to namcap but I don't know python so I gave up.

Offline

#5 2004-08-28 22:09:20

Xentac
Forum Fellow
From: Victoria, BC
Registered: 2003-01-17
Posts: 1,797
Website

Re: script to find missing library references

I have a similar script that I run on the actual repos.  I will use yours as a reference to see if I need to add anything else to mine.


I have discovered that all of mans unhappiness derives from only one source, not being able to sit quietly in a room
- Blaise Pascal

Offline

Board footer

Powered by FluxBB