Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 131986 - PORTAGE_CONFIGROOT emerge is polluted by host's package.mask
Summary: PORTAGE_CONFIGROOT emerge is polluted by host's package.mask
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-01 23:47 UTC by Arcanux
Modified: 2006-05-02 02:47 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 Arcanux 2006-05-01 23:47:08 UTC
When pointing PORTAGE_CONFIGROOT to an alternate rootfs, package.mask gets sourced by emerge not only from $PORTAGE_CONFIGROOT/etc/make.profile, but also from the host's /usr/portage/profiles directory. This is undesirable/incorrect behavior for PORTAGE_CONFIGROOT; /usr/portage/profiles/package.mask shouldn't be sourced at all when PORTAGE_CONFIGROOT is set.

I have a rootfs with a custom make.profile which doesn't inherit from existing Gentoo profiles. Included in this custom profile's "packages" file is the line:

  *dev-lang/swig

Using portage-2.1_pre10-r2, I run the following command:

  # ACCEPT_KEYWORDS="~ppc" PORTAGE_CONFIGROOT=/root/embedded_rootfs ROOT=/root/embedded_rootfs emerge system

Even though dev-lang/swig-1.3.27 is the latest swig and isn't masked by the custom profile's package.mask, emerge attempts to pull in version 1.3.25 instead. 1.3.27 is however masked in the host's package.mask. Editing /usr/portage/profiles/package.mask, I comment out the following line:

  =dev-lang/swig-1.3.27

I then run the above emerge command again and dev-lang/swig-1.3.27 gets pulled in as expected.

Excerpt from an strace log of open() calls made by emerge, in order called:

  open("/root/embedded_rootfs/usr/local/overlays/portage/profiles/arcanux/package.mask", O_RDONLY) = 4
  open("/root/embedded_rootfs/etc/portage/profile/package.mask", O_RDONLY) = -1 ENOENT (No such file or directory)
  open("/usr/portage/profiles/package.mask", O_RDONLY) = 4
  open("/root/embedded_rootfs/etc/portage/package.mask", O_RDONLY) = -1 ENOENT (No such file or directory)

The offending line in portage.py seems to be:

  pkgmasklines = [grabfile_package(os.path.join(x, "package.mask")) for x in self.profiles]

/usr/portage/profiles/package.mask is always in self.profiles, regardless of PORTAGE_CONFIGROOT setting.
Comment 1 Zac Medico gentoo-dev 2006-05-02 00:20:10 UTC
$PORTDIR/profiles/package.mask isn't part of any profile.  It's acutally package metadata that belongs to the package repository.  Don'e let it's location in $PORTDIR/profiles/ fool you into thinking differently.
Comment 2 Arcanux 2006-05-02 02:47:53 UTC
(In reply to comment #1)
package.mask's role as repo metadata seems sane enough, despite its contextually ambiguous placement in $PORTDIR/profiles. In light of this, package.mask "pollution" is justified because you wouldn't want custom profiles blindly ignoring a repo's metadata.

After further consideration I realize that $PORTAGE_CONFIGROOT/etc/make.profile/package.unmask would be an inappropriate place to override $PORTDIR/profiles/package.mask; this would more properly be done under $PORTAGE_CONFIGROOT/etc/portage.

I no longer see a case for this bug so I'm marking it WONTFIX.