From 1c6fb1c8d736da7c01f13fa6c55c6a5a4c060170 Mon Sep 17 00:00:00 2001 From: Steve Youngs Date: Wed, 20 Jan 2021 14:13:19 +1000 Subject: [PATCH] Update library symbol searching. * usr/bin/library-symbol-search (all_libs): Don't include the deprecated directory. Redirect objdump's stderr to /dev/null to avoid unnecessarily spamming stdout. Signed-off-by: Steve Youngs --- usr/bin/library-symbol-search | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/usr/bin/library-symbol-search b/usr/bin/library-symbol-search index b2f7ced..012074d 100755 --- a/usr/bin/library-symbol-search +++ b/usr/bin/library-symbol-search @@ -1,11 +1,11 @@ #!/bin/bash -# Copyright (C) 2008 - 2014 Steve Youngs +# Copyright (C) 2008 - 2021 Steve Youngs # Author: Steve Youngs # Maintainer: Steve Youngs # Created: <2008-03-10> -# Time-stamp: +# Time-stamp: # Homepage: N/A # Keywords: utils package-management @@ -73,12 +73,12 @@ fi lib_dirs=(/usr/lib /usr/X11R6/lib /lib) # bastard library directories... -#lib_dirs=(\ -# /usr/lib \ -# /usr/X11R6/lib \ -# /lib \ -# /opt/qt/lib \ -# /opt/kde/lib) +# lib_dirs=(\ +# /usr/lib \ +# /usr/X11R6/lib \ +# /lib \ +# /opt/qt/lib \ +# /opt/kde/lib) if [ "$1" = "-a" ]; then obj_opts="--demangle=gnu-v3 --reloc --syms --debugging" @@ -93,16 +93,16 @@ fi # $1 should now be the symbol (or symbol regexp) to search for sym=${1} -all_libs=$(find ${lib_dirs[*]} -name lost+found -prune -o \( -name lib\*.so\* -o -name lib\*.a \) -print) +all_libs=$(find ${lib_dirs[*]} \( -name deprecated -o -name lost+found \) -prune -o \( -name lib\*.so\* -o -name lib\*.a \) -print) for lib in ${all_libs} ; do unset good_file good_file="$(file ${lib}|grep '\(shared object\|ar archive\)' 2>/dev/null)" if [ -n "${good_file}" ]; then if [ $want_all -eq 1 ]; then - objdump ${obj_opts} ${lib}|grep -q -E ${sym} && echo ${lib} + objdump ${obj_opts} ${lib} 2>/dev/null|grep -q -E ${sym} && echo ${lib} else - objdump ${obj_opts} ${lib}|grep -v UND|grep -q -E ${sym} && echo ${lib} + objdump ${obj_opts} ${lib} 2>/dev/null|grep -v UND|grep -q -E ${sym} && echo ${lib} fi fi done -- 2.34.1