Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 347646 - sys-apps/portage-2.2.0_alpha4 has problems with make.profile being a relative symlink inside a relative symlinked dir
Summary: sys-apps/portage-2.2.0_alpha4 has problems with make.profile being a relative...
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-03 12:30 UTC by Dennis Schridde
Modified: 2010-12-04 09:32 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 Dennis Schridde 2010-12-03 12:30:14 UTC
# ll /etc/portage 
lrwxrwxrwx 1 root root 24 Dec  3 13:23 /etc/portage -> ../var/cache/portage/etc
# ll /etc/portage/make.profile
lrwxrwxrwx 1 root root 61 Dec  3 13:25 /etc/portage/make.profile -> ../gentoo/profiles/hardened/linux/ia64/server
-> portage does not complain about make.profile being broken, but it will silently assume no keywords are set.

When I change the setup to:
lrwxrwxrwx 1 root root 61 Dec  3 13:25 /etc/portage/make.profile -> /var/cache/portage/gentoo/profiles/hardened/linux/ia64/server
(no relative symlink anymore), portage will start working again.

Reproducible: Always
Comment 1 Zac Medico gentoo-dev 2010-12-04 04:48:00 UTC
It seems to work correctly for me, if I create a similar configuration for the default/linux/x86/10.0/desktop profile. I guess there's something different about your system. Did you create that hardened/linux/ia64/server profile yourself? If the parent files refer to symlinked locations, then you might have issues because of that. Portage's profile traversal code uses python's os.path.normpath() when resolving parents, and this function can do things like collapse '/foo/../bar' to '/bar', which yields invalid results for cases such as when '/foo' is a symlink.
Comment 2 Dennis Schridde 2010-12-04 08:28:59 UTC
(In reply to comment #1)
> Portage's profile traversal code uses python's
> os.path.normpath() when resolving parents, and this function can do things like
> collapse '/foo/../bar' to '/bar', which yields invalid results for cases such
> as when '/foo' is a symlink.
That is probably what happened to me, since /etc/portage is a symlink.
1) Is this a situation you would want to fix?
2) Will I have more luck with a hardlink?
Comment 3 Zac Medico gentoo-dev 2010-12-04 08:43:38 UTC
(In reply to comment #2)
> That is probably what happened to me, since /etc/portage is a symlink.

The portage code calls os.path.realpath() on make.profile, so that should resolve the /etc/portage symlink. Since I wasn't able to reproduce the problem with a similar configuration, I still need more information.

Please reproduce the problem, and then post the output of this command:

  python -c 'import portage ; print portage.settings.profiles'

That might give us a clue if there is a problem in the traversal of the profile parents.
Comment 4 Dennis Schridde 2010-12-04 09:15:11 UTC
# ll /etc/portage/make.profile
lrwxrwxrwx 1 root root 45 Dec  4 10:13 /etc/portage/make.profile -> ../gentoo/profiles/hardened/linux/ia64/server
# python -c 'import portage ; print portage.settings.profiles'
(u'/etc/gentoo/profiles/hardened/linux/ia64/server', u'/etc/portage/profile')

So it seems to get the dir wrong, but does not complain about it.
Comment 5 Zac Medico gentoo-dev 2010-12-04 09:20:39 UTC
Try this too please:

  python -c 'import os; print os.path.realpath("/etc/portage/make.profile")'
Comment 6 Dennis Schridde 2010-12-04 09:32:56 UTC
# ll /etc/portage/make.profile
lrwxrwxrwx 1 root root 45 Dec  4 10:32 /etc/portage/make.profile -> ../gentoo/profiles/hardened/linux/ia64/server
# python -c 'import os; print os.path.realpath("/etc/portage/make.profile")'
/var/cache/portage/gentoo/profiles/hardened/linux/ia64/server