Gentoo Wiki


This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

This article is still a Stub. You can help Gentoo-Wiki by expanding it.



Keep in mind that using bashrc in portage isn't supported, even if you use bashrcs from developers. So if you use one and things start breaking, you keep the pieces.


This file is one that is executed with certain parameters in various stages of an emerge. See for more information. Don't forget to replace all " <at> " by "@" there :) Here are some examples from some Gentoo developers:

Solar's example bashrc

From, this allows the 'distclean' FEATURES variable (to remove items from $DISTDIR after you're done with it), 'rats' and 'flawfinder' FEATURES flags (to run security checks on programs, along with support for simple /etc/portage/packages.cflags

An example of the first file's syntax can be seen at

ferringb's example bashrc

At this bashrc is designed for portage cvs head (not stable 2.0.51.x). It takes advantage of pre/post phase hooks to indicate what LD_PRELOAD protection and id the ebd is running as.

Beyond that, it has a hijacking of filter-env (c based bash parser for env filtering) to enable various, rather useful options to get debugging output from filter-env. Whether it be allowing it to dump core, having it dump the full env it was handed to full-dump-${EBUILD_PHASE}, or just valgrinding the bugger.

An older one

The one at seems to be a predecessor to solar's, this one seems nothing but debugging and package.cflags

Retrieved from ""

Last modified: Wed, 26 Dec 2007 15:21:00 +0000 Hits: 24,607