Magellan Linux

Annotation of /trunk/mage/usr/lib/mage/search_soname.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1644 - (hide annotations) (download) (as text)
Fri Jan 13 18:45:35 2012 UTC (12 years, 4 months ago) by niro
File MIME type: application/x-sh
File size: 771 byte(s)
-added some simple sanity checks
1 niro 1643 #!/bin/bash
2    
3     SCANELF="scanelf -nyRB"
4     SONAME="$1"
5     BINDIR="$2"
6    
7 niro 1644 if [[ -z ${SONAME} ]]
8     then
9     echo "No soname given!"
10     exit 1
11     fi
12    
13 niro 1643 if [[ -z ${BINDIR} ]]
14     then
15     # use scanelf opts to scan everything in path/ldpath
16     BINDIR="-p -l"
17     fi
18    
19     build_filename_list()
20     {
21     local files
22     local i
23    
24     files="$(${SCANELF} ${BINDIR} | grep ${SONAME} | cut -d' ' -f3)"
25     FILENAME_LIST="$(for i in ${files}; do echo ${i}; done | sort -u)"
26     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    
45     build_filename_list
46     #echo "${FILENAME_LIST}"
47     build_depname_list
48     echo "${DEPNAME_LIST}"

Properties

Name Value
svn:executable *