aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2007-02-06 14:49:49 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2007-02-06 14:49:49 +0000
commit321b4e76b29bffe252e242c4b793c10acaa6239f (patch)
tree949347cfa618236cbfe33e41ba7cd64dddff2439
parent9cffd9337da043e3282fc5f8ace52e74311007e6 (diff)
downloadrpm-setup-321b4e76b29bffe252e242c4b793c10acaa6239f.tar
rpm-setup-321b4e76b29bffe252e242c4b793c10acaa6239f.tar.gz
rpm-setup-321b4e76b29bffe252e242c4b793c10acaa6239f.tar.bz2
rpm-setup-321b4e76b29bffe252e242c4b793c10acaa6239f.tar.xz
rpm-setup-321b4e76b29bffe252e242c4b793c10acaa6239f.zip
Use objdump instead of ldd for devel dependencies finder (#25877)
-rwxr-xr-xfind-requires.in27
1 files changed, 20 insertions, 7 deletions
diff --git a/find-requires.in b/find-requires.in
index 553c34c..6aabbd5 100755
--- a/find-requires.in
+++ b/find-requires.in
@@ -10,9 +10,9 @@ ulimit -c 0
#
# --- Set needed to 0 for traditional find-requires behavior.
needed=1
-if [ X"$1" = Xldd ]; then
+if [ X"$3" = Xldd ]; then
needed=0
-elif [ X"$1" = Xobjdump ]; then
+elif [ X"$3" = Xobjdump ]; then
needed=1
fi
@@ -213,11 +213,24 @@ fi
for i in `echo $filelist | tr '[:blank:]' "\n" | egrep "(/usr(/X11R6)?)?/lib(|64)/[^/]+\.so$"`; do
objd=`objdump -p ${i} | grep SONAME`
lib64=`if file -L $i 2>/dev/null | grep "ELF 64-bit" >/dev/null; then echo "(64bit)"; fi` && \
- [ -h ${i} -a -n "${objd}" ] && \
- ldd ${i} \
- | grep -v "statically linked" \
- | grep -v "/\(lib\|lib64\)/\(ld\|ld64\|ld-linux.*\)\.so" \
- | perl -p -e "s/\s+(\S+)\.so.*/devel(\1$lib64)/g"
+ if [ -h ${i} -a -n "${objd}" ]; then
+ if [ "$needed" -eq 1 ]; then
+ ldd ${i} \
+ | grep -v "statically linked" \
+ | grep -v "/\(lib\|lib64\)/\(ld\|ld64\|ld-linux.*\)\.so" \
+ | perl -p -e "s/\s+(\S+)\.so.*/devel(\1$lib64)/g"
+ else
+ objdump -p $i | awk 'BEGIN { START=0; }
+ /^$/ { START=0; }
+ /^Dynamic Section:$/ { START=1; }
+ (START==1) && /NEEDED/ {
+ sub(/^/, "devel(", $2) ;
+ sub(/\.so.*$/, "'$lib64')", $2) ;
+ print $2 ;
+ }
+ '
+ fi
+ fi
done | egrep -v 'devel\(linux-gate|linux-vdso32|linux-vdso64|lib(c|pthread|rt)(\(64bit\))?\)' | sort -u
#