1 |
On 07-05-2007 13:25:48 +0200, Michael Haubenwallner wrote: |
2 |
> > What if a relative link is given? |
3 |
> |
4 |
> Valid point: then this is resolved to a file which is unlikely to exist, |
5 |
> because it is started relative to $D, and the check will abort. |
6 |
> |
7 |
> OTOH, gen_usr_ldscript() generates absolute symlinks, and this check |
8 |
> ensures that: if there is no usr/lib/lib.so, there must not be a |
9 |
> lib/lib.so. |
10 |
> |
11 |
> But ok - what about this followup-patch: |
12 |
> |
13 |
> for a in "${ED}"usr/lib*/*.a ; do |
14 |
a = usr/lib/libfoo.a |
15 |
> s=${a%.a}.so |
16 |
s = usr/lib/libfoo.so |
17 |
> - if [[ -L ${s} ]] ; then |
18 |
> - s=${D}$(readlink "${s}") || s=${a%.a}.so |
19 |
> + if [[ -L ${s} ]] && rs=$(readlink "${s}"); then |
20 |
rs = ../lib/libfoo.so.1 |
21 |
> + [[ ${rs} == /* ]] && s="${D}${rs}" || s="${ED}usr/lib/${rs}" |
22 |
s = lib/libfoo.so.1 |
23 |
> fi |
24 |
> if [[ ! -e ${s} ]] ; then |
25 |
> + s=${a%.a}.so |
26 |
s = lib/libfoo.so.1.so |
27 |
or |
28 |
s = usr/lib/libfoo.so.so |
29 |
I think this is wrong. Is the replacement really necessary? I think .a |
30 |
has always been replaced in this case. |
31 |
> s=${s%usr/*}${s##*/usr/} |
32 |
s = lib/libfoo.so(.so) |
33 |
> + if [[ -L ${s} ]] && rs=$(readlink "${s}"); then |
34 |
> + [[ ${rs} == /* ]] && s="${D}${rs}" || s="${ED}usr/lib/${rs}" |
35 |
Hmmm... if s is a link, and it is relative, should it start from |
36 |
${ED}lib in that case? |
37 |
> + fi |
38 |
> if [[ -e ${s} ]] ; then |
39 |
> vecho -ne '\a\n' |
40 |
> eqawarn "QA Notice: Missing gen_usr_ldscript for ${s##*/}" |
41 |
> abort="yes" |
42 |
> fi |
43 |
> fi |
44 |
> done |
45 |
|
46 |
Really difficult stuff... |
47 |
|
48 |
> > Apparently an invalid symlink makes -e (existence test) fail? |
49 |
> |
50 |
> Exactly. |
51 |
> The symlink ${ED}usr/lib/lib.so points to ${EPREFIX}/lib/lib.so, which |
52 |
> does not exist because the package is not merged yet. Thus, 'test -e' |
53 |
> fails on that symlink. |
54 |
> |
55 |
> /haubi/ |
56 |
|
57 |
-- |
58 |
Fabian Groffen |
59 |
Gentoo on a different level |
60 |
|
61 |
-- |
62 |
gentoo-alt@g.o mailing list |