Magellan Linux

Contents of /trunk/mage/usr/lib/mage/autodepend.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2039 - (show annotations) (download) (as text)
Fri Feb 1 09:40:30 2013 UTC (11 years, 3 months ago) by niro
File MIME type: application/x-sh
File size: 836 byte(s)
-really honor prefix
1 #!/bin/bash
2
3 SCANELF="scanelf -LnyRB"
4 BINDIR="$1"
5
6 if [[ -z ${BINDIR} ]]
7 then
8 echo "No \$BINDIR given"
9 exit 1
10 fi
11
12 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 local prefix
29
30 # 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 for soname in ${SONAME_LIST}
37 do
38 deps+=" $(magequery -e ${prefix}${soname})"
39 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 echo "${DEPNAME_LIST}" | sed 's:\(.*\)-r.*:>= \1:'

Properties

Name Value
svn:executable *