Gentoo Archives: gentoo-devhelp

From: Dan Douglas <ormaaj@×××××.com>
To: gentoo-devhelp@l.g.o
Subject: Re: [gentoo-devhelp] Trouble with package.env files
Date: Sun, 27 May 2012 20:47:21
Message-Id: 1618304.LGGTs6sFNt@smorgbox
In Reply to: [gentoo-devhelp] Trouble with package.env files by Nikos Chantziaras
On Sunday, May 27, 2012 11:21:31 PM Nikos Chantziaras wrote:
> I have this in /etc/portage/package.env: > > app-emulation/emul-linux-x86-soundlibs soundlibs-delete-jack.conf > > and this in /etc/portage/env/soundlibs-delete-jack.conf: > > if [ "${EBUILD_PHASE}" == "src_prepare"] ; > then > rm -rf "${S}"/usr/lib32/jack > rm -f $(find "${S}" -name 'libjack*') > fi
The env/!(bashrc) files are parsed using Python shlex at the time emerge is run, accepting essentially the same types of expressions that are valid in /etc/make.conf. It never goes through a shell. The reason this is "preferred" is certainly for performance, and due to certain things not being possible in abashrc such as setting FEATURES. The two options for defining phase hooks are the portage/bashrc file, and portage/env/CATEGORY/PKG. The bashrc file is global and if present always runs, while the package-specific ones are of course package-specific. Personally, I just use the global bashrc and handle the logic for selecting packages internally. I find it a bit easier to manage than many separate files. setupHookPtrs() { set -- "$@" 'categoryPtrs["$1"]' "$1"'["$2"]' local -A categoryPtrs=( [app-shells]='( [bash]=doBash [ksh]=doKsh )' [media-gfx]='( [digikam]=dgKamFix )' [sys-devel]='( [binutils]=doBinutils )' [www-client]='( [chromium]=chromiumHack )' ) \ ${categoryPtrs["$1"]+"$1"="${!3}"} ${categoryPtrs["$1"]+"${!4-:}"} # Call whatever function. } setupHookPtrs "$CATEGORY" "$PN" -- Dan Douglas


File name MIME type
signature.asc application/pgp-signature