1 |
In Prefix, there is a distinction between variables used with |
2 |
config_root and target_root. Quoting from prefix' const.py: |
3 |
|
4 |
# We have a most confusing situation here, which is most of all pretty |
5 |
# weak for protecting us from making mistakes. |
6 |
# First there is a config_root (PORTAGE_CONFIGROOT) which can be a path |
7 |
# somewhere, from which all paths need to be relative (e.g. |
8 |
# etc/portage), hence those constants do NOT have EPREFIX, because |
9 |
# config_root contains EPREFIX by default -- overriding it loses the |
10 |
# EPREFIX as one would expect. |
11 |
# Second there is target_root (ROOT) which is to install somewhere |
12 |
# completely else, in Prefix of limited use. Because this is an offset |
13 |
# always given, the EPREFIX should always be applied in it. Those |
14 |
# constants (like VDB_PATH) DO have EPREFIX. |
15 |
# Unfortunately this file is ordered quite horrible in this respect. |
16 |
|
17 |
The attached patch makes all variables against config_root relative (by |
18 |
removing the leading '/'), with the result that all lstrip(os.sep) calls |
19 |
in the code can be removed. Please note that all but two occurences did |
20 |
use config_root. For one (pym/portage/__init__.py; sandbox stuff) I've |
21 |
added it, for the other (in pym/portage/output.py) I don't know how to |
22 |
get config_root, so substituted '/', which breaks Prefix by design. |
23 |
|
24 |
How about this patch, and if it is a good idea, how about grouping all |
25 |
of these config_root variables such that it's easier to see what is |
26 |
what? I actually ran into this because Sebastian was hitting it with |
27 |
his smolt-gentoo tool. |
28 |
|
29 |
|
30 |
-- |
31 |
Fabian Groffen |
32 |
Gentoo on a different level |