From: Neil Bothwick <neil@digimed.co.uk>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] How is /etc/portage/env supposed to work?
Date: Tue, 20 Oct 2015 16:37:03 +0100 [thread overview]
Message-ID: <20151020163703.3ed0c01c@hactar.digimed.co.uk> (raw)
In-Reply-To: <n05hkq$ao3$1@ger.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1812 bytes --]
On Tue, 20 Oct 2015 17:04:10 +0300, Nikos Chantziaras wrote:
> I'm following the documentation here:
>
> https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/Advanced#Using_.2Fetc.2Fportage.2Fenv
>
> to hook into the postinst phase of an ebuild. The docs only provide an
> actual example for the global hook case (/etc/portage/bashrc), but it
> says it works the same way on a per-ebuild basis
> using /etc/portage/env. But it is totally silent on how to actually do
> that :-/
>
> 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
>
> Then I added this line to /etc/portage/package.env:
>
> app-misc/mc test.conf
>
> 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 don't get it... Can't I have a per-package bashrc or something? The
> docs are suggesting that I can, but don't tell me how.
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.
--
Neil Bothwick
"We demand rigidly defined areas of doubt and uncertainty!"
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2015-10-20 15:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-20 14:04 [gentoo-user] How is /etc/portage/env supposed to work? Nikos Chantziaras
2015-10-20 14:26 ` Michael Orlitzky
2015-10-20 16:35 ` [gentoo-user] " Nikos Chantziaras
2015-10-20 18:24 ` [gentoo-user] " Alan McKinnon
2015-10-22 20:03 ` [gentoo-user] " Nikos Chantziaras
2015-10-23 2:05 ` Michael Orlitzky
2015-10-20 14:58 ` [gentoo-user] " Alexander Kapshuk
2015-10-20 15:37 ` Neil Bothwick [this message]
2015-10-20 16:32 ` [gentoo-user] " Nikos Chantziaras
2015-10-20 20:20 ` Neil Bothwick
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151020163703.3ed0c01c@hactar.digimed.co.uk \
--to=neil@digimed.co.uk \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox