Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 133740 - Overlays override /etc/portage for package.mask
Summary: Overlays override /etc/portage for package.mask
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 136244 137445 336692
  Show dependency tree
 
Reported: 2006-05-18 18:05 UTC by Ed Catmur
Modified: 2010-09-10 20:49 UTC (History)
0 users

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


Attachments
portage-stack-etc-last.patch (portage-stack-etc-last.patch,1.35 KB, patch)
2006-05-18 18:09 UTC, Ed Catmur
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Catmur 2006-05-18 18:05:58 UTC
portage 2.1_rc1-r3.

portage.config.__init__ has (ll 1138-1145):

		abs_user_config = os.path.join(config_root,
			USER_CONFIG_PATH.lstrip(os.path.sep))
		locations = [os.path.join(self["PORTDIR"], "profiles"),
			abs_user_config]
		for ov in self["PORTDIR_OVERLAY"].split():
			ov = os.path.normpath(ov)
			if os.path.isdir(ov+"/profiles"):
				locations.append(ov+"/profiles")

This means that profiles/package.mask in overlays comes later in the stack than /etc/portage/package.mask, so /etc/portage cannot remove lines from the stack or readd lines the overlay profiles/package.mask removes.

Suggest put /etc/portage after overlay profiles/ in stack. Patch to follow.
Comment 1 Marius Mauch (RETIRED) gentoo-dev 2006-05-18 18:08:50 UTC
/etc/portage/ isn't supposed to be in the stack at all
Comment 2 Ed Catmur 2006-05-18 18:09:11 UTC
Created attachment 87027 [details, diff]
portage-stack-etc-last.patch
Comment 3 Ed Catmur 2006-05-18 18:14:36 UTC
(In reply to comment #1)
> /etc/portage/ isn't supposed to be in the stack at all

Not for most profile stuff, sure, but it is for package.mask. Has been at least since the migrate to svn.
Comment 4 Zac Medico gentoo-dev 2006-05-18 19:35:35 UTC
The stacking order and incremental behavior is currently undocumented, which is bad, so we need to document it.  Currently, the order is as follows:

1) /etc/make.profile (parents followed by children)
2) /etc/portage/profile
3) $PORTDIR/profiles
4) /etc/portage
5) $PORTDIR_OVERLAY/profiles (from left to right)

Here is a new proposed order:

1) $PORTDIR/profiles
2) /etc/make.profile (parents followed by children)
3) /etc/portage/profile
4) $PORTDIR_OVERLAY/profiles (from left to right)
5) /etc/portage

Feedback?
Comment 5 Ed Catmur 2006-05-18 20:09:14 UTC
Hmm. I'd argue that:
a) PORTDIR/profiles and OVERLAY/profiles are similar in concept, so should be adjacent in the stack, with OVERLAY/profiles later
b) /etc/portage needs to be able to override anything, so should go last in the stack
c) Only advanced users will know what to do with /etc/portage/profile, so it should go after PORTDIR and OVERLAYs
d) make.profile typically points to a profile in PORTDIR, so OVERLAY/profiles should go after make.profile

This gives:
1. /etc/make.profile (parents before children)
2. $PORTDIR/profiles
3. $PORTDIR_OVERLAY/profiles (left-to-right)
4. /etc/portage/profile
5. /etc/portage
Comment 6 Zac Medico gentoo-dev 2006-05-18 21:41:38 UTC
(In reply to comment #5)
> Hmm. I'd argue that:
> a) PORTDIR/profiles and OVERLAY/profiles are similar in concept, so should be
> adjacent in the stack, with OVERLAY/profiles later

I'd say usefulness should weigh more than things being "similar in concept".

> b) /etc/portage needs to be able to override anything, so should go last in
> stack

Agreed.

> c) Only advanced users will know what to do with /etc/portage/profile, so it
> should go after PORTDIR and OVERLAYs

/etc/portage/profile is the last of the profile stack (see python -c 'import portage; print portage.settings.profiles') so I think it should come after make.profile.

> d) make.profile typically points to a profile in PORTDIR, so OVERLAY/profiles
> should go after make.profile

Well, OVERLAY/profiles has nothing to do with make.profile.  It's more similar to $PORTDIR/profiles and /etc/portage (none of which are part of a profile per se).  Don't let the directory name "profiles" make you think that it has anything to do with a profile.  That just happens to be the location of the global package.mask file for the repo.
Comment 7 Ed Catmur 2006-05-20 19:27:04 UTC
(In reply to comment #6)
> /etc/portage/profile is the last of the profile stack (see python -c 'import
> portage; print portage.settings.profiles') so I think it should come after
> make.profile.
Ah. Yeah, good point.

The issue I have with $PORTDIR/profiles and $PORTDIR_OVERLAY/profiles being nonadjacent is that I can see a Gentoo dev working in an overlay and then being surprised when things don't behave as expected when that overlay is folded into the main gentoo-x86 tree. That suggests:

1. /etc/make.profile (parents before children)
2. /etc/portage/profile
3. $PORTDIR/profiles
4. $PORTDIR_OVERLAY/profiles (left-to-right)
5. /etc/portage

However, I can see that arch devs would want to be able to (in extremis) override $PORTDIR/profiles with the /etc/make.profile tree.

OK: arch devs need to be able to override $PORTDIR/profiles; /etc/portage/profile is the end of the /etc/make.profile stack; overlay writers need to be able to override all the $PORTDIR machinery. And /etc/portage is the last word. This means your proposed order in comment 4 is correct. Thanks for bearing with me on this.
Comment 8 Zac Medico gentoo-dev 2006-06-11 19:48:06 UTC
This is fixed in svn r3495.
Comment 9 Zac Medico gentoo-dev 2006-06-16 10:01:38 UTC
This has been released in 2.1.1_pre1.
Comment 10 Zac Medico gentoo-dev 2010-09-10 15:37:43 UTC
(In reply to comment #8)
> This is fixed in svn r3495.

Via gitweb:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4590565f93f6c5be8269e0c322960d18929a0fd6
Comment 11 Zac Medico gentoo-dev 2010-09-10 20:49:28 UTC
There's a new order in git now:
config from other repos than PORTDIR comes before profiles (like PORTDIR)

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=ca9a73ad87b56f0997b566f24f251dbe345389fd

And there's a related commit for bug 336692 here:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cc129641968902ff8e791a840dff339e45632a0f