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.


Reply via email to