From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SYkMz-0008IE-KU for garchives@archives.gentoo.org; Sun, 27 May 2012 20:47:21 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7BB90E0768; Sun, 27 May 2012 20:47:08 +0000 (UTC) Received: from mail-ob0-f181.google.com (mail-ob0-f181.google.com [209.85.214.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 43434E0768 for ; Sun, 27 May 2012 20:47:08 +0000 (UTC) Received: by obbuo19 with SMTP id uo19so5320954obb.40 for ; Sun, 27 May 2012 13:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=qFOFRlrUkZ2zy2pf/qyXRv2qlAUwdHbixnmq/nIFclY=; b=SUUEinOBFGXy16ljljvzsliIs5qEnZFqbKuKfsYynexz/2OM1LRhsJL6lpia8Sxgr1 fKM24JF+l5W/GgBlZ/cap06UusfYzAV3CVdvqsKbB4ZwYoZkQ98PcSo5t0uecleuPgCS /ICsh29tBIfjsqH+9A+pmb7mTN197Nl5SdFxksJUfRgggIMVRTe334ROlHSfkp23ihx5 0ZaMLuDrV8jlx5PP18tM8/wzCdIxdtVTZCG5JYJNWlM03atWV6S7yhIOGoAkyqcmLs0n CjDBlJ5nnxcT+tIFKHqD/DwihZwb1sRpZoHVkYB4HMQV5hxwdWEebBBBHVxudvMg7EbF 94ng== Received: by 10.50.12.199 with SMTP id a7mr3008810igc.71.1338151627700; Sun, 27 May 2012 13:47:07 -0700 (PDT) Received: from smorgbox.localnet (65-128-181-111.mpls.qwest.net. [65.128.181.111]) by mx.google.com with ESMTPS id nz4sm4343529igc.14.2012.05.27.13.47.06 (version=SSLv3 cipher=OTHER); Sun, 27 May 2012 13:47:07 -0700 (PDT) From: Dan Douglas To: gentoo-devhelp@lists.gentoo.org Subject: Re: [gentoo-devhelp] Trouble with package.env files Date: Sun, 27 May 2012 15:46:55 -0500 Message-ID: <1618304.LGGTs6sFNt@smorgbox> User-Agent: KMail/4.8.3 (Linux/3.4.1-pf+; KDE/4.8.3; x86_64; ; ) In-Reply-To: References: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Development-related help X-BeenThere: gentoo-devhelp@gentoo.org X-BeenThere: gentoo-devhelp@lists.gentoo.org Reply-To: gentoo-devhelp@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart47795258.btKgOAV7Jb"; micalg="pgp-sha1"; protocol="application/pgp-signature" Content-Transfer-Encoding: 7Bit X-Archives-Salt: c4e1d089-d8f5-4f33-9060-378a16d16b49 X-Archives-Hash: 8b2776c642b6398cbbcc894654edbf6f --nextPart47795258.btKgOAV7Jb Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" 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 --nextPart47795258.btKgOAV7Jb Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iEYEABECAAYFAk/CksQACgkQMmyDamdg+MwRHwCbBjAASbh7tUb5xX+u5nzSokaY J/sAoIZ2opOsmuRJZLOxH6jH2W7JK93x =rSek -----END PGP SIGNATURE----- --nextPart47795258.btKgOAV7Jb--