1 |
Hello, everyone. |
2 |
|
3 |
Here is a rebase of my recent work on bringing setup.py install for |
4 |
Portage. |
5 |
|
6 |
|
7 |
About the patches: |
8 |
|
9 |
(1) teaches the self-update function to deal with PORTAGE_PYM_PATH that |
10 |
contains more packages than Portage itself. In particular, it makes it |
11 |
copy packages of Portage only rather than everything found in 'pym' :). |
12 |
|
13 |
(2) makes PORTAGE_PYM_PATH contain wherever Portage is loaded from |
14 |
rather than 'pym' subdirectory of PORTAGE_BASE_PATH. This makes the code |
15 |
work well when 'pym' directory is removed. |
16 |
|
17 |
(3) makes sure that all important test files are suffixed with .py so |
18 |
that they are installed by setup.py without extra hackery. |
19 |
|
20 |
(4) fixes all the remaining issues with tests, allowing them to be run |
21 |
on the installed copy of Portage. |
22 |
|
23 |
(5) replaces the Makefiles with setup.py. It's distutils with a few |
24 |
extensions -- mostly making it possible to install scripts to multiple |
25 |
locations, install data files recursively and override all the paths. |
26 |
|
27 |
(6) updates .travis.yml to run tests using setup.py, and also try |
28 |
installing and re-running tests after install. |
29 |
|
30 |
I will follow this thread with updated ebuild. |
31 |
|
32 |
|
33 |
About the new install layout: |
34 |
|
35 |
1. /usr/lib/portage/pym no longer exists. Python files are installed |
36 |
directly to site-packages for each implementation (by default). |
37 |
|
38 |
2. /usr/lib/portage/bin no longer contains copies of the scripts that |
39 |
are installed to /usr/bin and /usr/sbin. |
40 |
|
41 |
3. All Python scripts have proper shebangs set by distutils. To fit this |
42 |
with how distutils usually works and how the eclass expects it to be |
43 |
done, my ebuild had done a few more changes: |
44 |
|
45 |
3a. all programs from /usr/sbin are moved to /usr/bin, and all programs |
46 |
in /usr/bin are wrapped. |
47 |
|
48 |
3b. The Portage internal tools are moved from /usr/lib/portage/bin |
49 |
to /usr/lib/portage/${EPYTHON} so that no Python mismatch is possible. |
50 |
|
51 |
3c. /usr/lib/portage/bin became a symlink for external tool |
52 |
compatibility. It uses the 'last' Python implementation as chosen |
53 |
by distutils-r1. |
54 |
|
55 |
|
56 |
I have tested these changes for a while and I think Portage itself can |
57 |
handle them well. However, some of the external tools overrelying on |
58 |
Portage itself can be broken, eix in particular. |
59 |
|
60 |
In particular, tools that want to play with Portage internals need to |
61 |
export proper PORTAGE_BIN_PATH and PORTAGE_PYM_PATH before spawning |
62 |
them. The correct values can be obtained using portageq: |
63 |
|
64 |
$ portageq envvar PORTAGE_BIN_PATH |
65 |
/usr/lib/portage/python3.4 |
66 |
$ portageq envvar PORTAGE_PYM_PATH |
67 |
/usr/lib64/python3.4/site-packages |
68 |
|
69 |
|
70 |
Please look through the patches and test at will :). Thanks. |
71 |
|
72 |
-- |
73 |
Michał Górny |