Gentoo Archives: gentoo-user

From: Alexander Kapshuk <alexander.kapshuk@×××××.com>
To: Gentoo mailing list <gentoo-user@l.g.o>
Subject: Re: [gentoo-user] How is /etc/portage/env supposed to work?
Date: Tue, 20 Oct 2015 14:59:17
Message-Id: CAJ1xhMWQopmiY1FpYiUaH8YrHu88tGCpFijWLk9vO0MBiy1dig@mail.gmail.com
In Reply to: [gentoo-user] How is /etc/portage/env supposed to work? by Nikos Chantziaras
1 On Tue, Oct 20, 2015 at 5:04 PM, Nikos Chantziaras <realnc@×××××.com> wrote:
2
3 > I'm following the documentation here:
4 >
5 >
6 > https://wiki.gentoo.org/wiki/Handbook:AMD64/Portage/Advanced#Using_.2Fetc.2Fportage.2Fenv
7 >
8 > to hook into the postinst phase of an ebuild. The docs only provide an
9 > actual example for the global hook case (/etc/portage/bashrc), but it says
10 > it works the same way on a per-ebuild basis using /etc/portage/env. But it
11 > is totally silent on how to actually do that :-/
12 >
13 > So I assume, since the docs don't mention anything special, that I should
14 > put the code in a conf file. So I created this file:
15 >
16 > /etc/portage/env/test.conf
17 >
18 > and in it:
19 >
20 > if [ "${EBUILD_PHASE}" == "postinst" ];
21 > then
22 > echo ":: TEST"
23 > fi
24 >
25 > Then I added this line to /etc/portage/package.env:
26 >
27 > app-misc/mc test.conf
28 >
29 > But when I "emerge app-misc/mc", I get:
30 >
31 > !!! Problem in 'app-misc/mc' dependencies.
32 > !!! "/etc/portage/env/test.conf", line 1: Invalid token '[' (not '=')
33 > portage.exception
34 > ... done!
35 > "/etc/portage/env/test.conf", line 1: Invalid token '[' (not '=')
36 >
37
38 According to test(1), comparing two strings for equality is done using a
39 single '=':
40 STRING1 = STRING2
41 the strings are equal
42
43 Try '[ "${EBUILD_PHASE}" = postinst ]' to hush the 'invalid token' thingie.
44
45
46 >
47 > I don't get it... Can't I have a per-package bashrc or something? The docs
48 > are suggesting that I can, but don't tell me how.
49 >
50 >
51 >