Magellan Linux

Annotation of /branches/mage-next/src/tools/search_soname.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2573 - (hide annotations) (download)
Wed Jan 29 12:27:04 2014 UTC (10 years, 3 months ago) by niro
File size: 785 byte(s)
-removed executable property
1 niro 1643 #!/bin/bash
2 niro 2268 # $Id$
3 niro 1643
4 niro 2522 #scanelf 0.7 has a bug, it ignores the first element in the path
5     PATH="/lala:${PATH}"
6    
7 niro 1953 SCANELF="scanelf -yRBqN"
8 niro 1643 SONAME="$1"
9     BINDIR="$2"
10    
11 niro 1644 if [[ -z ${SONAME} ]]
12     then
13     echo "No soname given!"
14     exit 1
15     fi
16    
17 niro 1643 if [[ -z ${BINDIR} ]]
18     then
19     # use scanelf opts to scan everything in path/ldpath
20     BINDIR="-p -l"
21     fi
22    
23     build_filename_list()
24     {
25 niro 1953 FILENAME_LIST="$(${SCANELF} ${SONAME} ${BINDIR} | cut -d' ' -f3 | sort -u)"
26 niro 1643 export FILENAME_LIST
27     }
28    
29     build_depname_list()
30     {
31     local file
32     local deps
33     local i
34    
35     for file in ${FILENAME_LIST}
36     do
37     # search exact filenames!
38     deps+=" $(magequery -e ${file})"
39     done
40     DEPNAME_LIST="$(for i in ${deps}; do echo ${i}; done | sort -u)"
41     export DEPNAME_LIST
42     }
43    
44     build_filename_list
45     #echo "${FILENAME_LIST}"
46     build_depname_list
47     echo "${DEPNAME_LIST}"