Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2039 - (hide annotations) (download) (as text)
Fri Feb 1 09:40:30 2013 UTC (11 years, 3 months ago) by niro
Original Path: trunk/mage/usr/lib/mage/autodepend.sh
File MIME type: application/x-sh
File size: 836 byte(s)
-really honor prefix
1 niro 1643 #!/bin/bash
2    
3 niro 1954 SCANELF="scanelf -LnyRB"
4 niro 1643 BINDIR="$1"
5    
6 niro 1644 if [[ -z ${BINDIR} ]]
7     then
8     echo "No \$BINDIR given"
9     exit 1
10     fi
11    
12 niro 1643 build_soname_list()
13     {
14     local sonames
15     local i
16     sonames="$(${SCANELF} ${BINDIR} | cut -d' ' -f2 | sed 's:,:\ :g')"
17    
18     # now drop all duplicates
19     SONAME_LIST="$(for i in ${sonames}; do echo ${i}; done | sort -u)"
20     export SONAME_LIST
21     }
22    
23     build_dep_list()
24     {
25     local soname
26     local deps
27     local i
28 niro 1954 local prefix
29 niro 1643
30 niro 1954 # if /lib /lib64 are symlinks than add a prefix to honor usr-move
31     if [[ -L /lib ]] || [[ -L /lib64 ]]
32     then
33     prefix="/usr"
34     fi
35    
36 niro 1643 for soname in ${SONAME_LIST}
37     do
38 niro 2039 deps+=" $(magequery -e ${prefix}${soname})"
39 niro 1643 done
40     DEPNAME_LIST="$(for i in ${deps}; do echo ${i}; done | sort -u)"
41     export DEPNAME_LIST
42     }
43    
44     build_soname_list
45     build_dep_list
46    
47     #echo "${SONAME_LIST}"
48 niro 1954 echo "${DEPNAME_LIST}" | sed 's:\(.*\)-r.*:>= \1:'

Properties

Name Value
svn:executable *