Gentoo Archives: gentoo-portage-dev

From: Tim Harder <radhermit@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] make PORTAGE_BIN_PATH settings relocatable
Date: Tue, 02 Jun 2015 05:27:50
Message-Id: 20150602052742.GA24048@thor.home.lan
In Reply to: Re: [gentoo-portage-dev] [PATCH] make PORTAGE_BIN_PATH settings relocatable by Mike Frysinger
1 On 2015-06-02 00:31, Mike Frysinger wrote:
2 > > > (d) some other alternative ?
3 > > If you're sticking with bash, there is also pkgcore's approach of using
4 > > a custom shebang script that handles initialization and related generic
5 > > things for most of the helpers.
6
7 > shebangs have to be absolute which defeats the relocatable approach :(
8
9 > although i could create a single wrapper script which would do the bootstrap and
10 > then source the final script, and all the other tools would be symlinks to that.
11 > like we do with newins/newbin/etc...
12
13 Ah sure, so then you'd need to copy more of the underlying solution as
14 well. In summary, currently a file (_const.py) gets generated at install
15 time with all the relevant paths that can change. If that file doesn't
16 exist (in git repos and unpacked tarballs) relative paths are used
17 instead (and env overrides are supported as well if needed). The dir
18 containing the shebang script is added to PATH for each ebuild process
19 and /usr/bin/env is used to execute it in the shebangs.
20
21 In short, it sort of combines a relocatable at install time approach
22 with the inverse of portage's usage of its .portage_not_installed file.
23
24 Tim