Gentoo Archives: gentoo-alt

From: Michael Haubenwallner <michael.haubenwallner@×××××××.at>
To: gentoo-alt@l.g.o
Subject: Re: [gentoo-alt] AIX: libiconv issues still ?
Date: Mon, 07 May 2007 11:26:16
Message-Id: 1178537148.6035.79.camel@sapc154
In Reply to: Re: [gentoo-alt] AIX: libiconv issues still ? by Fabian Groffen
1 On Fri, 2007-05-04 at 22:05 +0200, Fabian Groffen wrote:
2 > On 23-04-2007 10:43:06 +0200, Michael Haubenwallner wrote:
3 > > On Fri, 2007-04-20 at 17:53 +0200, Fabian Groffen wrote:
4 > > > On 20-04-2007 10:43:56 -0500, Marshall McMullen wrote:
5 > > > > WOO HOO , that worked! You ROCK Haubi !
6 > > >
7 > > > So wait, hold on. Where do I have to apply which patch now?
8 > > >
9 > >
10 > > to portage (bin/misc-functions.sh), the attached one.
11 >
12 > > --- bin/misc-functions.sh.orig 2007-04-04 17:49:18.003057000 +0200
13 > > +++ bin/misc-functions.sh 2007-04-04 17:58:24.466904000 +0200
14 > > @@ -312,6 +312,9 @@
15 > > abort="no"
16 > > for a in "${ED}"usr/lib*/*.a ; do
17 > > s=${a%.a}.so
18 > > + if [[ -L ${s} ]] ; then
19 > > + s=${D}$(readlink "${s}") || s=${a%.a}.so
20 >
21 > What's the || for? (A trail of previous && || usage?)
22
23 This is just a fallback if 'readlink' fails.
24 Yes, this works even if it fails inside $().
25
26 >
27 > > + fi
28 > > if [[ ! -e ${s} ]] ; then
29 > > s=${s%usr/*}${s##*/usr/}
30 > > if [[ -e ${s} ]] ; then
31 >
32 > I think this patch isn't safe.
33
34 I've also thought that this might be unsafe, but after some more
35 debugging, i've seen that it is as safe as the original check:
36 The original check does not ensure that the library-wrapper-script
37 usr/lib/lib.so actually refers to lib/lib.so, nor does this patch.
38
39 > What if a relative link is given?
40
41 Valid point: then this is resolved to a file which is unlikely to exist,
42 because it is started relative to $D, and the check will abort.
43
44 OTOH, gen_usr_ldscript() generates absolute symlinks, and this check
45 ensures that: if there is no usr/lib/lib.so, there must not be a
46 lib/lib.so.
47
48 But ok - what about this followup-patch:
49
50 for a in "${ED}"usr/lib*/*.a ; do
51 s=${a%.a}.so
52 - if [[ -L ${s} ]] ; then
53 - s=${D}$(readlink "${s}") || s=${a%.a}.so
54 + if [[ -L ${s} ]] && rs=$(readlink "${s}"); then
55 + [[ ${rs} == /* ]] && s="${D}${rs}" || s="${ED}usr/lib/${rs}"
56 fi
57 if [[ ! -e ${s} ]] ; then
58 + s=${a%.a}.so
59 s=${s%usr/*}${s##*/usr/}
60 + if [[ -L ${s} ]] && rs=$(readlink "${s}"); then
61 + [[ ${rs} == /* ]] && s="${D}${rs}" || s="${ED}usr/lib/${rs}"
62 + fi
63 if [[ -e ${s} ]] ; then
64 vecho -ne '\a\n'
65 eqawarn "QA Notice: Missing gen_usr_ldscript for ${s##*/}"
66 abort="yes"
67 fi
68 fi
69 done
70
71 >
72 > Apparently an invalid symlink makes -e (existence test) fail?
73
74 Exactly.
75 The symlink ${ED}usr/lib/lib.so points to ${EPREFIX}/lib/lib.so, which
76 does not exist because the package is not merged yet. Thus, 'test -e'
77 fails on that symlink.
78
79 /haubi/
80
81
82 --
83 Salomon Automation GmbH - Friesachstrasse 15 - A-8114 Friesach bei Graz
84 Sitz der Gesellschaft: Friesach bei Graz
85 UID-NR:ATU28654300 - Firmenbuchnummer: 49324 K
86 Firmenbuchgericht: Landesgericht für Zivilrechtssachen Graz
87
88 --
89 gentoo-alt@g.o mailing list

Replies

Subject Author
Re: [gentoo-alt] AIX: libiconv issues still ? Fabian Groffen <grobian@g.o>