Gentoo Archives: gentoo-user

From: Nikos Chantziaras <realnc@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] How is /etc/portage/env supposed to work?
Date: Tue, 20 Oct 2015 14:04:47
Message-Id: n05hkq$ao3$1@ger.gmane.org
1 I'm following the documentation here:
2
3 https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/Advanced#Using_.2Fetc.2Fportage.2Fenv
4
5 to hook into the postinst phase of an ebuild. The docs only provide an
6 actual example for the global hook case (/etc/portage/bashrc), but it
7 says it works the same way on a per-ebuild basis using /etc/portage/env.
8 But it is totally silent on how to actually do that :-/
9
10 So I assume, since the docs don't mention anything special, that I
11 should put the code in a conf file. So I created this file:
12
13 /etc/portage/env/test.conf
14
15 and in it:
16
17 if [ "${EBUILD_PHASE}" == "postinst" ];
18 then
19 echo ":: TEST"
20 fi
21
22 Then I added this line to /etc/portage/package.env:
23
24 app-misc/mc test.conf
25
26 But when I "emerge app-misc/mc", I get:
27
28 !!! Problem in 'app-misc/mc' dependencies.
29 !!! "/etc/portage/env/test.conf", line 1: Invalid token '[' (not '=')
30 portage.exception
31 ... done!
32 "/etc/portage/env/test.conf", line 1: Invalid token '[' (not '=')
33
34 I don't get it... Can't I have a per-package bashrc or something? The
35 docs are suggesting that I can, but don't tell me how.

Replies

Subject Author
Re: [gentoo-user] How is /etc/portage/env supposed to work? Michael Orlitzky <mjo@g.o>
Re: [gentoo-user] How is /etc/portage/env supposed to work? Alexander Kapshuk <alexander.kapshuk@×××××.com>
Re: [gentoo-user] How is /etc/portage/env supposed to work? Neil Bothwick <neil@××××××××××.uk>