]>
git.ipfire.org Git - people/ms/pakfire.git/blob - tools/find-provides
4 BASEDIR
=$
(dirname ${0})
5 source ${BASEDIR}/find-common
14 # Walk through all file files and see what we have got here.
17 */usr
/lib
*/python
*/*.so
*)
18 # Do not show python shared objects in provides list.
21 file_is_elf
${file} >/dev
/null
2>&1 && \
22 binary_files
="${binary_files} ${file}"
25 # This file is a perl module. We check them later.
26 perl_files
="${perl_files} ${file}"
29 pkgconfig_files
="${pkgconfig_files} ${file}"
34 # Search for SONAMEs in all binary files.
35 for file in ${binary_files}; do
36 [ -L ${file} ] && continue
38 soname
=$
(file_get_soname
${file})
40 # If the files does not have a SONAME, we will
41 # simply use the basename.
42 if [ -z "${soname}" ]; then
43 if [ -L ${file} ]; then
46 soname
=$
(basename ${file})
49 if file_is_64bit
${file}; then
51 echo "${soname}${mark64}"
57 # Find weak symbol provides.
58 objdump
-p ${file} 2>/dev
/null |
awk '
60 /Version definitions:/ { START=1; }
61 /^[0-9]/ && (START==1) { print $4; }
62 /^$/ { START=0; }' | \
64 while read symbol
; do
65 echo "${soname}(${symbol})$(${is_64} && echo ${mark64} | sed 's/()//')"
69 # Search for perl provides.
70 if [ -n "${perl_files}" ] && [ -x /usr
/bin
/perl
]; then
71 perl
${BASEDIR}/perl.prov
${perl_files} |
sort -u
75 pkgconfig
=$
(which pkg-config
)
77 if [ -n "${pkgconfig}" -a -x "${pkgconfig}" ]; then
78 for file in ${pkgconfig_files}; do
79 # Query the dependencies of the package.
80 ${pkgconfig} --print-provides "${file}" 2> /dev
/null |
while read n r v
; do
81 # We have a dependency. Make a note that we need the pkgconfig
82 # tool for this package.
83 echo "pkgconfig(${n}) ${r} ${v}"