]>
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
/debug
/*|
*/usr
/src
/debug
/*)
18 # Skip all debuginfo files.
21 */usr
/lib
*/python
*/*.so
*)
22 # Do not show python shared objects in provides list.
29 # Skip symlinks for performance reasons.
30 [ -L "${file}" ] && continue
32 file_is_elf
${file} >/dev
/null
2>&1 && \
33 binary_files
="${binary_files} ${file}"
36 # This file is a perl module. We check them later.
37 perl_files
="${perl_files} ${file}"
40 pkgconfig_files
="${pkgconfig_files} ${file}"
45 # Search for SONAMEs in all binary files.
46 for file in ${binary_files}; do
47 soname
=$
(file_get_soname
${file})
49 # If the files does not have a SONAME, we will
50 # simply use the basename.
51 if [ -z "${soname}" ]; then
52 if [ -L ${file} ]; then
55 soname
=$
(basename ${file})
58 if file_is_64bit
${file}; then
60 echo "${soname}${mark64}"
66 # Find weak symbol provides.
67 objdump
-p ${file} 2>/dev
/null |
awk '
69 /Version definitions:/ { START=1; }
70 /^[0-9]/ && (START==1) { print $4; }
71 /^$/ { START=0; }' | \
73 while read symbol
; do
74 echo "${soname}(${symbol})$(${is_64} && echo ${mark64} | sed 's/()//')"
78 # Search for perl provides.
79 if [ -n "${perl_files}" ] && [ -x /usr
/bin
/perl
]; then
80 perl
${BASEDIR}/perl.prov
${perl_files} |
sort -u
84 pkgconfig
=$
(which pkg-config
)
86 if [ -n "${pkgconfig}" -a -x "${pkgconfig}" ]; then
87 for file in ${pkgconfig_files}; do
88 # Query the dependencies of the package.
89 ${pkgconfig} --print-provides "${file}" 2> /dev
/null |
while read n r v
; do
90 # We have a dependency. Make a note that we need the pkgconfig
91 # tool for this package.
92 echo "pkgconfig(${n}) ${r} ${v}"