1 |
On 2015-06-01 13:25, Mike Frysinger wrote: |
2 |
> > -source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh |
3 |
> > +if [[ -z ${PORTAGE_BIN_PATH} ]] ; then |
4 |
> > + PORTAGE_BIN_PATH=$(dirname "$(dirname "$(readlink -f "$0")")") |
5 |
> > +fi |
6 |
> > +source "${PORTAGE_BIN_PATH}"/isolated-functions.sh |
7 |
|
8 |
> alternative crazy ideas: |
9 |
|
10 |
> (a) just throw an error and exit when PORTAGE_BIN_PATH is not set ... |
11 |
> considering the current portage code points to a path where it is no longer |
12 |
> installed, maybe that's ok ? the recent changes to make portage install copies |
13 |
> for each python version is what broke it i think. |
14 |
|
15 |
> (b) add a tool alongside it that can be `eval`-ed, although you'd still need to |
16 |
> do something like: |
17 |
> if [[ -z ${PORTAGE_BIN_PATH} ]] ; then |
18 |
> eval $("$(dirname "$(readlink -f "$0")")/some-tool") |
19 |
> fi |
20 |
> and i don't think that's an improvement relative to my patch (deal with quoting |
21 |
> bs and such). |
22 |
|
23 |
> (c) convert most things to python and use relative module imports to get at the |
24 |
> bootstrap module. then that one would hold all the logic. |
25 |
|
26 |
> (d) some other alternative ? |
27 |
|
28 |
If you're sticking with bash, there is also pkgcore's approach of using |
29 |
a custom shebang script that handles initialization and related generic |
30 |
things for most of the helpers. |
31 |
|
32 |
Tim |