From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 3ECE413888F for ; Tue, 20 Oct 2015 16:32:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B328621C058; Tue, 20 Oct 2015 16:32:35 +0000 (UTC) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A72FF21C018 for ; Tue, 20 Oct 2015 16:32:32 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZoZpo-0004jp-Ig for gentoo-user@lists.gentoo.org; Tue, 20 Oct 2015 18:32:24 +0200 Received: from athedsl-354632.home.otenet.gr ([85.72.240.230]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Oct 2015 18:32:24 +0200 Received: from realnc by athedsl-354632.home.otenet.gr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Oct 2015 18:32:24 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-user@lists.gentoo.org From: Nikos Chantziaras Subject: [gentoo-user] Re: How is /etc/portage/env supposed to work? Date: Tue, 20 Oct 2015 19:32:15 +0300 Message-ID: References: <20151020163703.3ed0c01c@hactar.digimed.co.uk> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: athedsl-354632.home.otenet.gr User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: <20151020163703.3ed0c01c@hactar.digimed.co.uk> X-Archives-Salt: 83ee4992-2aa4-484c-b989-68d2f36c6384 X-Archives-Hash: 54c97e2acd5798329e4e8b200c61dd5e On 20/10/15 18:37, Neil Bothwick wrote: > On Tue, 20 Oct 2015 17:04:10 +0300, Nikos Chantziaras wrote: > >> So I assume, since the docs don't mention anything special, that I >> should put the code in a conf file. So I created this file: >> >> /etc/portage/env/test.conf >> >> and in it: >> >> if [ "${EBUILD_PHASE}" == "postinst" ]; >> then >> echo ":: TEST" >> fi >> [...] >> >> But when I "emerge app-misc/mc", I get: >> >> !!! Problem in 'app-misc/mc' dependencies. >> !!! "/etc/portage/env/test.conf", line 1: Invalid token '[' (not '=') >> portage.exception >> ... done! >> "/etc/portage/env/test.conf", line 1: Invalid token '[' (not '=') > > I'm nut sure you can put that sort of thing in package.env, I thought it > was only for settings variables, like make.conf but per-package. You can > add function calls in /etc/portage/env/cat/pkg, for example I have > used this for a couple of packages that didn't support epatch_user > > post_src_unpack() { > cd "${S}" > epatch_user > } > > AFAIK you can do this for any of the standard ebuild functions listed in > man 5 ebuild. Thanks! That works just fine. Btw, you can put your epatch_user in /etc/portage/bashrc instead and have it for all packages. It is safe to have it twice even in packages that do support epatch_user. That function is specifically written for this use case, so that even when using it multiple times, the patches are only applied once.