Annotation of /trunk/mage/usr/lib/mage/autodepend.sh
Parent Directory | Revision Log
Revision 3205 -
(hide annotations)
(download)
(as text)
Mon Aug 21 19:12:49 2023 UTC (9 months, 2 weeks ago) by niro
File MIME type: application/x-sh
File size: 1278 byte(s)
Mon Aug 21 19:12:49 2023 UTC (9 months, 2 weeks ago) by niro
File MIME type: application/x-sh
File size: 1278 byte(s)
-always run ldconfig
1 | niro | 1643 | #!/bin/bash |
2 | niro | 2268 | # $Id$ |
3 | niro | 1643 | |
4 | niro | 1954 | SCANELF="scanelf -LnyRB" |
5 | niro | 1643 | BINDIR="$1" |
6 | |||
7 | niro | 1644 | if [[ -z ${BINDIR} ]] |
8 | then | ||
9 | echo "No \$BINDIR given" | ||
10 | exit 1 | ||
11 | fi | ||
12 | |||
13 | niro | 1643 | build_soname_list() |
14 | { | ||
15 | local sonames | ||
16 | local i | ||
17 | sonames="$(${SCANELF} ${BINDIR} | cut -d' ' -f2 | sed 's:,:\ :g')" | ||
18 | |||
19 | # now drop all duplicates | ||
20 | SONAME_LIST="$(for i in ${sonames}; do echo ${i}; done | sort -u)" | ||
21 | export SONAME_LIST | ||
22 | } | ||
23 | |||
24 | build_dep_list() | ||
25 | { | ||
26 | local soname | ||
27 | niro | 2803 | local libdir |
28 | niro | 1643 | local deps |
29 | local i | ||
30 | niro | 1954 | local prefix |
31 | niro | 2823 | local resolved |
32 | niro | 1643 | |
33 | for soname in ${SONAME_LIST} | ||
34 | do | ||
35 | niro | 2803 | # if /lib /lib64 are symlinks than add a prefix to honor usr-move |
36 | libdir="${soname%/*}" | ||
37 | prefix="" | ||
38 | niro | 2823 | resolved="" |
39 | niro | 3173 | if [[ ${libdir} = /lib ]] || [[ ${libdir} = /lib64 ]] || [[ ${libdir} = /lib32 ]] |
40 | niro | 2803 | then |
41 | niro | 3173 | if [[ -L /lib ]] || [[ -L /lib64 ]] || [[ -L /lib32 ]] |
42 | niro | 2803 | then |
43 | prefix="/usr" | ||
44 | fi | ||
45 | fi | ||
46 | niro | 2823 | |
47 | resolved="$(magequery -e ${prefix}${soname})" | ||
48 | if [[ -z ${resolved} ]] | ||
49 | then | ||
50 | niro | 3172 | # soname in the actual build included? |
51 | niro | 3191 | if [[ -z $(find ${BINDIR} -name $(basename ${soname})) ]] |
52 | niro | 3172 | then |
53 | resolved="${prefix}${soname}:_not_found" | ||
54 | fi | ||
55 | niro | 2823 | fi |
56 | deps+=" ${resolved}" | ||
57 | niro | 1643 | done |
58 | DEPNAME_LIST="$(for i in ${deps}; do echo ${i}; done | sort -u)" | ||
59 | export DEPNAME_LIST | ||
60 | } | ||
61 | |||
62 | niro | 3205 | ldconfig |
63 | niro | 1643 | build_soname_list |
64 | build_dep_list | ||
65 | |||
66 | #echo "${SONAME_LIST}" | ||
67 | niro | 1954 | echo "${DEPNAME_LIST}" | sed 's:\(.*\)-r.*:>= \1:' |
Properties
Name | Value |
---|---|
svn:executable | * |