Your question is difficult to answer - here's why
First, ldd is a tool that reads the binary file of an executable and
prints out dependency information found in the executable
(and in it's dependent libraries) - a simple read a few files and print
the results.
Answering the question who uses a library, is much more difficult. It
typically requires that something is maintaining a database that says
which packages require what libraries. This has 2 vaults
1. it assumes everything you care about was installed by the package
manager.
2. it doesn't always seem to work.
I just tried a few things and they all failed miserably.
On a rpm based system the program xsane uses libsane.so.1 ,
theoretically one can do
rpm -qif /lib64/libsane.so.1
This reports that this library is provided by (on my system)
sane-backends-libs package Version 1.0.27
next
rpm -q --whatrequires sane-backends-libs
this reports no package requires sane-backends-libs
never mind that the package xsane which contains program xsane does
require it.
It seems the next not too time consuming approach is something like the
following script
#!/bin/ksh
lib=libsane.so
#for dir in /bin /usr/bin /sbin ; do
for dir in /usr/bin ; do
for file in `ls $dir` ; do
if ldd $dir/$file |& grep -s $lib > /dev/null ; then
echo $file match
fi
done
done
i.e. search every directory on the system that has an executable file in
it and check it out with ldd.
This is painful as first you need a list of every directory that
contains executables. Now adays it
seems that /bin and /sbin are just links into /usr/bin so only 1
directory to search. But now a days
many tools have 'alternatives', so there is a script in /usr/bin that
checks which alternative you have selected
and then executes that program, where ever it might be stored. And of
course each user may have a cache of
programs they have installed locally somewhere in there home directory.
So to really answer the question, you probably need to use find to find
any executable on the system, and see if
it has the required dependency. Not something the package manager would
handle
Rich Shepard wrote:
On Thu, 22 Mar 2018, Ben Koenig wrote:
Slackware:
- Responsibility of the user
- by default nothing in slackware has the capability to record
dependencies.
- You would keep track of this manually, or install an extra tool.
- rpm is installed by default, however since no packages were
installed via
rpm it has no knowledge of what is installed
Ben,
I thought there might be a generic linux tool equivalent to ldd. My
specific interest is with SlackBuilds.org packages and I suspect
there's a
way of searching the repo for this information in each package's info
file.
It's likely that one of the package maintainers will suggest a search
protocol.
Regards,
Rich
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug