1 |
Hello, all. |
2 |
|
3 |
I think I'm finally ready to put all the breaking awesomeness that was |
4 |
waiting for the git eclasses. However, I'm wondering what's the best |
5 |
way of proceeding with it. |
6 |
|
7 |
We've just lately finished the git->git-2 eclass migration. The old |
8 |
eclass is no longer used and is marked for removal in a few days. |
9 |
|
10 |
The new eclass is supposedly used by 732 in-tree packages [1], |
11 |
and possibly a few dozens out-of-the-tree. Some parts of the eclass API |
12 |
are barely used. I would really prefer to avoid yet another eclass |
13 |
migration. |
14 |
|
15 |
[1]:http://qa-reports.gentoo.org/output/eclass-usage/ |
16 |
|
17 |
|
18 |
However, I would like to do a few breaking changes to simplify |
19 |
the eclass and its maintenance: |
20 |
|
21 |
1. Make EGIT_SOURCEDIR default to ${WORKDIR}/${P} rather than ${S} |
22 |
(to support setting S to subdirectory of git repo), |
23 |
|
24 |
2. Kill EGIT_HAS_SUBMODULES and autodetect submodules, |
25 |
|
26 |
3. Kill EGIT_OPTIONS since it limits the possibility of changing eclass |
27 |
code, |
28 |
|
29 |
4. Kill EGIT_MASTER (it's more trouble than benefit), |
30 |
|
31 |
5. Possibly kill EGIT_PROJECT -- it won't be good enough anymore, |
32 |
|
33 |
6. Kill EGIT_NONBARE and support bare checkouts only. Supporting two |
34 |
different layouts introduces a lot redundant code. |
35 |
|
36 |
7. Kill EGIT_NOUNPACK -- possibly replace it with proper fetching |
37 |
function, or just src_fetch(), |
38 |
|
39 |
8. Kill EGIT_DIR -- it supposedly should not even be overriden. |
40 |
|
41 |
|
42 |
But it's not all removing. There are also a few things I would like to |
43 |
change/add: |
44 |
|
45 |
1. Replace 'git clone' with 'git init' + 'git fetch' that would be |
46 |
a bit simpler, |
47 |
|
48 |
2. Add complete & working support for shallow clones, and make it the |
49 |
default. This means a lot of space-saving for people who only use |
50 |
the repos for ebuilds. |
51 |
|
52 |
3. Add complete & proper support for submodules. Currently, submodules |
53 |
enforce non-bare clones and are fetched during unpack. After |
54 |
the change, they will be fetched and unpacked like normal repos. |
55 |
|
56 |
|
57 |
The use of API features in *.ebuild maps like the following; |
58 |
|
59 |
EGIT_REPO_URI 521 |
60 |
EGIT_BRANCH 66 |
61 |
EGIT_SOURCEDIR 21 |
62 |
EGIT_PROJECT 17 |
63 |
EGIT_HAS_SUBMODULES 15 |
64 |
EGIT_COMMIT 12 |
65 |
EGIT_BOOTSTRAP 12 |
66 |
EGIT_MASTER 7 |
67 |
EGIT_NOUNPACK 2 |
68 |
EGIT_STORE_DIR 1 |
69 |
EGIT_NONBARE 1 |
70 |
EGIT_DIR 1 |
71 |
EVCS_OFFLINE 0 // these are for make.conf |
72 |
EGIT_REPACK 0 |
73 |
EGIT_PRUNE 0 |
74 |
EGIT_OPTIONS 0 |
75 |
|
76 |
I will need to take a look which of those cases can be replaced easily. |
77 |
|
78 |
|
79 |
How should I proceed? Assuming that git-2.eclass is used by live |
80 |
ebuilds only, and those ebuilds can be subject to random breakage, |
81 |
I could supposedly just start changing API of the eclass. |
82 |
|
83 |
On the other hand, I could also go for beautiful git-r1.eclass, |
84 |
and cleanly switch the packages. |
85 |
|
86 |
Then, I could go for something involving the two -- create a new |
87 |
git-r1.eclass that has API fully stripped, and start deprecating |
88 |
features from git-2.eclass. We would be able to switch to git-r1 to |
89 |
test offending packages safely, then do a big switch of remaining |
90 |
packages and make the two eclasses temporarily equivalent. |
91 |
|
92 |
What are your thoughts? |
93 |
|
94 |
-- |
95 |
Best regards, |
96 |
Michał Górny |