Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 299163 - sys-apps/portage-2.2.00.15134: broken AIX logic in misc-functions.sh
Summary: sys-apps/portage-2.2.00.15134: broken AIX logic in misc-functions.sh
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All AIX
: High major (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-31 21:14 UTC by Jeremy Olexa (darkside) (RETIRED)
Modified: 2010-01-12 15:50 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-12-31 21:14:06 UTC
postinst_aix() is a beast to debug, but there is some broken logic in it. I have on my aix-5.3 prefix, multiple packages that fail the same way:

 * ERROR: dev-libs/openssl-0.9.8l-r2 failed:
 *   cannot chmod /home/jolexa/portage/aix-5.3/usr/lib/libcrypto.a
 * 
 * Call stack:
 *   misc-functions.sh, line 1435:  Called postinst_aix
 *   misc-functions.sh, line 1163:  Called die
 * The specific snippet of code:
 *             chmod a+r,u+w "${ROOT}${archive}" || die "cannot chmod ${archive}"


 * ERROR: sys-libs/readline-6.0_p4 failed:
 *   cannot chmod /home/jolexa/portage/aix-5.3/lib/libreadline.a
 * 
 * Call stack:
 *   misc-functions.sh, line 1435:  Called postinst_aix
 *   misc-functions.sh, line 1163:  Called die
 * The specific snippet of code:
 *             chmod a+r,u+w "${ROOT}${archive}" || die "cannot chmod ${archive}"

%% ls /home/jolexa/portage/aix-5.3/usr/lib/libreadline.a
/home/jolexa/portage/aix-5.3/usr/lib/libreadline.a
%% ls /home/jolexa/portage/aix-5.3/lib/libreadline.a
ls: cannot access /home/jolexa/portage/aix-5.3/lib/libreadline.a: No such file or directory

%% emerge --version
Portage 2.2.00.15134-prefix (prefix/aix/5.3.0.0/ppc, gcc-4.2.4, unavailable, 3 00C9087D4C00)
Comment 1 Fabian Groffen gentoo-dev 2010-01-08 12:00:47 UTC
can you try >=portage-2.2.00.15177?
Comment 2 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-01-11 22:40:24 UTC
(In reply to comment #1)
> can you try >=portage-2.2.00.15177?
> 

No. I'm in a world of pain now.

exec(): 0509-036 Cannot load program wget because of the following errors:
        0509-150   Dependent module /home/jolexa/portage/aix-5.3/usr/lib/libssl.a(libssl.so.0.9.8) could not be loaded.

Will need more time.
Comment 3 Michael Haubenwallner (RETIRED) gentoo-dev 2010-01-12 09:20:44 UTC
To understand what happens here, reading bug#213277 (both the comments and its URL field) might help.

Eventually it would be easiest to rebootstrap your AIX prefix from scratch, sorry!

This postinst_aix() function is part of portage's preserve-libs feature.
Comment 4 Fabian Groffen gentoo-dev 2010-01-12 10:25:24 UTC
haubi: the logic in that function looks wrong.  If you can't read it and can't write it, you chmod it, and if that fails you die.  While in this case the whole file doesn't exist, so it seems you should either check that first and die with a proper error, or figure out why that file wasn't moved from usr/lib to lib (or something)
Comment 5 Michael Haubenwallner (RETIRED) gentoo-dev 2010-01-12 10:44:45 UTC
(In reply to comment #1)
> can you try >=portage-2.2.00.15177?

btw: when a shell command ends with '||' or '&&', the command is continued on the next line without backslash.
So r15177 doesn't change anything here, these linebreaks were by intention.
Comment 6 Michael Haubenwallner (RETIRED) gentoo-dev 2010-01-12 11:05:08 UTC
(In reply to comment #4)
> haubi: the logic in that function looks wrong.  If you can't read it and can't
> write it, you chmod it, and if that fails you die.  While in this case the
> whole file doesn't exist, so it seems you should either check that first and
> die with a proper error, or figure out why that file wasn't moved from usr/lib
> to lib (or something)

Even when the nonexistent archive is ignored _here_, you won't get a working library after all.

The problem here is that when there is a shared member of an archive, the archive "stub" wasn't merged by portage *before* my preserve-libs port for aix.
Instead, the archives were concealed from portages's merge by those crappy profile.bashrc hacks. Most likely it is this removal still found in saved environment.bz2 that causes the troubles here.

Counting the real aix users made me ignore this problem - as we did before, sorry for the headache!

Please bootstrap your aix prefix from scratch, thank you!
Comment 7 Fabian Groffen gentoo-dev 2010-01-12 11:30:45 UTC
ok, cool, so the code is as intended, thanks!
Comment 8 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-01-12 15:50:54 UTC
ohh, I got it. Sorry, the other bug was over my head until now (still is, but I understand it better). Thanks for the explaining, haubi.