Contents of /trunk/mage/usr/lib/mage/autodepend.sh
Parent Directory | Revision Log
Revision 1644 -
(show annotations)
(download)
(as text)
Fri Jan 13 18:45:35 2012 UTC (12 years, 8 months ago) by niro
File MIME type: application/x-sh
File size: 679 byte(s)
Fri Jan 13 18:45:35 2012 UTC (12 years, 8 months ago) by niro
File MIME type: application/x-sh
File size: 679 byte(s)
-added some simple sanity checks
1 | #!/bin/bash |
2 | |
3 | SCANELF="scanelf -nyRB" |
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 | |
29 | for soname in ${SONAME_LIST} |
30 | do |
31 | deps+=" $(magequery -f ${soname})" |
32 | done |
33 | DEPNAME_LIST="$(for i in ${deps}; do echo ${i}; done | sort -u)" |
34 | export DEPNAME_LIST |
35 | } |
36 | |
37 | build_soname_list |
38 | build_dep_list |
39 | |
40 | #echo "${SONAME_LIST}" |
41 | echo "${DEPNAME_LIST}" | sed 's:\(.*\)-r.*:>= \1:' |
Properties
Name | Value |
---|---|
svn:executable | * |