gentoo-alt  

Re: [gentoo-alt] AIX: libiconv issues still ?

Michael Haubenwallner
Mon, 07 May 2007 04:26:06 -0700

On Fri, 2007-05-04 at 22:05 +0200, Fabian Groffen wrote:
> On 23-04-2007 10:43:06 +0200, Michael Haubenwallner wrote:
> > On Fri, 2007-04-20 at 17:53 +0200, Fabian Groffen wrote:
> > > On 20-04-2007 10:43:56 -0500, Marshall McMullen wrote:
> > > > WOO HOO , that worked! You ROCK Haubi !
> > > 
> > > So wait, hold on.  Where do I have to apply which patch now?
> > > 
> > 
> > to portage (bin/misc-functions.sh), the attached one.
> 
> > --- bin/misc-functions.sh.orig      2007-04-04 17:49:18.003057000 +0200
> > +++ bin/misc-functions.sh   2007-04-04 17:58:24.466904000 +0200
> > @@ -312,6 +312,9 @@
> >     abort="no"
> >     for a in "${ED}"usr/lib*/*.a ; do
> >             s=${a%.a}.so
> > +           if [[ -L ${s} ]] ; then
> > +                   s=${D}$(readlink "${s}") || s=${a%.a}.so
> 
> What's the || for?  (A trail of previous && || usage?)

This is just a fallback if 'readlink' fails.
Yes, this works even if it fails inside $().

> 
> > +           fi
> >             if [[ ! -e ${s} ]] ; then
> >                     s=${s%usr/*}${s##*/usr/}
> >                     if [[ -e ${s} ]] ; then
> 
> I think this patch isn't safe.

I've also thought that this might be unsafe, but after some more
debugging, i've seen that it is as safe as the original check:
The original check does not ensure that the library-wrapper-script
usr/lib/lib.so actually refers to lib/lib.so, nor does this patch.

> What if a relative link is given?

Valid point: then this is resolved to a file which is unlikely to exist,
because it is started relative to $D, and the check will abort.

OTOH, gen_usr_ldscript() generates absolute symlinks, and this check
ensures that: if there is no usr/lib/lib.so, there must not be a
lib/lib.so.

But ok - what about this followup-patch:

    for a in "${ED}"usr/lib*/*.a ; do
        s=${a%.a}.so
-       if [[ -L ${s} ]] ; then
-           s=${D}$(readlink "${s}") || s=${a%.a}.so
+       if [[ -L ${s} ]] && rs=$(readlink "${s}"); then
+           [[ ${rs} == /* ]] && s="${D}${rs}" || s="${ED}usr/lib/${rs}"
        fi
        if [[ ! -e ${s} ]] ; then
+           s=${a%.a}.so
            s=${s%usr/*}${s##*/usr/}
+           if [[ -L ${s} ]] && rs=$(readlink "${s}"); then
+               [[ ${rs} == /* ]] && s="${D}${rs}" || s="${ED}usr/lib/${rs}"
+           fi
            if [[ -e ${s} ]] ; then
                vecho -ne '\a\n'
                eqawarn "QA Notice: Missing gen_usr_ldscript for ${s##*/}"
                abort="yes"
            fi
        fi
    done

> 
> Apparently an invalid symlink makes -e (existence test) fail?

Exactly.
The symlink ${ED}usr/lib/lib.so points to ${EPREFIX}/lib/lib.so, which
does not exist because the package is not merged yet. Thus, 'test -e'
fails on that symlink.

/haubi/


-- 
Salomon Automation GmbH - Friesachstrasse 15 - A-8114 Friesach bei Graz
Sitz der Gesellschaft: Friesach bei Graz
UID-NR:ATU28654300 - Firmenbuchnummer: 49324 K
Firmenbuchgericht: Landesgericht für Zivilrechtssachen Graz

--
[EMAIL PROTECTED] mailing list