1 |
Probably not the ideal solution given that you seem to prefer removal of such variables, but a REPODIR variable which is set to the directory where the repo is (basically making PORTDIR dynamic and setting it on a per package basis) could enable developers to reference their repo when needed, allowing variable use in a multi repo system. Additionally, if that idea is liked, I think an array of the repos masters and/or their dirs (or some functions to access that information) could also be useful. Like get_masters and get_repo_dir functions. |
2 |
|
3 |
Just some ideas and I have no real attachments, but just figured I would brainstorm and put them out there. |
4 |
|
5 |
On November 21, 2015 4:36:57 PM EST, "Michał Górny" <mgorny@g.o> wrote: |
6 |
>Hello, everyone. |
7 |
> |
8 |
>Currently PMS defines two variables that are being repeatedly abused to |
9 |
>access repository data in unpredictable and breaking manners -- PORTDIR |
10 |
>and ECLASSDIR. They both reference only so-called 'master |
11 |
>repository', are permitted in source builds and src_* phases only. |
12 |
> |
13 |
>For quite some time, QA is monitoring their use and repeatedly |
14 |
>reporting abuses and spec violations. I'd like to run a joint QA & PMS |
15 |
>team effort in cleaning up those variables for sane multi-repository |
16 |
>support or banning them altogether. For this reason, I would like to |
17 |
>know your opinion. |
18 |
> |
19 |
> |
20 |
>Licenses [1] |
21 |
>------------ |
22 |
> |
23 |
>So far, the most common use of ${PORTDIR} was to access the licenses |
24 |
>subdirectory. That has a number of issues -- most importantly, it fails |
25 |
>when the license is provided by another repository. It is also unusable |
26 |
>in binary packages. |
27 |
> |
28 |
>So far I see two major possibilities here. We can either decide that: |
29 |
> |
30 |
>a. ebuilds don't need to access licenses directly and if they do, |
31 |
>the licenses are usually included in distfiles or can be obtained |
32 |
>independently of ebuild tree, or |
33 |
> |
34 |
>b. we provide a proper, safe mechanism for obtaining licenses that |
35 |
>works with multiple repositories and binary packages. In particular, |
36 |
>I was thinking of establishing a LICENSEDIR that would contain copies |
37 |
>or symlinks to all needed licenses, both in source and binary installs. |
38 |
> |
39 |
>Few relevant current bugs: |
40 |
> |
41 |
>- sci-visualization/veusz: replaces bundled license with PORTDIR |
42 |
> symlink, which will fail if repository is moved or when using binary |
43 |
> packages [2], |
44 |
> |
45 |
>- sci-biology/foldingathome: tries to reference the license |
46 |
> in pkg_setup(), while PORTDIR is valid only in src_* [3], |
47 |
> |
48 |
>- sys-block/tw_cli: copies license into install. The license is not |
49 |
> included in tarball, yet we have different opinions whether copying |
50 |
> it is necessary or not [4]. |
51 |
> |
52 |
> |
53 |
>Eclasses [5] |
54 |
>------------ |
55 |
> |
56 |
>The next thing is ECLASSDIR, sometimes disguised as equivalent |
57 |
>${PORTDIR}/eclass. It is used only by a single developer, for two |
58 |
>reasons. One is to create eclass-manpages whose ebuild is a huge hack |
59 |
>relying on random deprecated Portage variables anyway, so not worth |
60 |
>noting. The other is to access a huge collection of patches (over 100 |
61 |
>files) which are stored in eclass/ELT-patches and not ever used on most |
62 |
>of Gentoo systems. |
63 |
> |
64 |
>We've considered different options on how to make ECLASSDIR sane and so |
65 |
>far seems there's no real way of doing it while keeping the ELT-patches |
66 |
>thing working (the way suggested for licenses won't work, for example). |
67 |
>So for less sane solutions, again we have two: |
68 |
> |
69 |
>A. ban ECLASSDIR completely, and move ELT-patches to a dedicated |
70 |
>package [6]. This way, it could be cleanly managed, versioned |
71 |
>and filtered to install only files relevant to user's system (i.e. not |
72 |
>for all potential prefixes we support), and libtool.eclass can simply |
73 |
>DEPEND on it. Furthermore, a lot of the code could be moved to |
74 |
>a reusable external patcher tool. |
75 |
> |
76 |
>B. Restrict ECLASSDIR to be available only in global scope of |
77 |
>eclasses (i.e. while sourcing them), and set it to the repository from |
78 |
>which eclass is sourced. This is ugly, barely predictable but should |
79 |
>work. Well, as long as you copy the whole ELT-patches structure along |
80 |
>with libtool.eclass. |
81 |
> |
82 |
> |
83 |
>PORTDIR [7] |
84 |
>----------- |
85 |
> |
86 |
>Almost all uses of PORTDIR are covered by the two above categories. |
87 |
>The only remaining use is games-mods.eclass using it to read header.txt |
88 |
>file from the repository [8]. Which in fact could be trivially replaced |
89 |
>if games team members had a little different attitude towards QA but |
90 |
>I guess that's not my problem. |
91 |
> |
92 |
>Therefore, I think that if both of the above issues are solved either |
93 |
>way, PORTDIR should be banned completely. Until then, we'd like it to |
94 |
>be QA-deprecated and discouraged from being used unless absolutely |
95 |
>necessary. |
96 |
> |
97 |
> |
98 |
>What are your thoughts? |
99 |
> |
100 |
> |
101 |
>[1]:https://bugs.gentoo.org/show_bug.cgi?id=566412 |
102 |
>[2]:https://bugs.gentoo.org/show_bug.cgi?id=341653 |
103 |
>[3]:https://bugs.gentoo.org/show_bug.cgi?id=566402 |
104 |
>[4]:https://bugs.gentoo.org/show_bug.cgi?id=566416 |
105 |
>[5]:https://bugs.gentoo.org/show_bug.cgi?id=373351 |
106 |
>[6]:https://bugs.gentoo.org/show_bug.cgi?id=566424 |
107 |
>[7]:https://bugs.gentoo.org/show_bug.cgi?id=373349 |
108 |
>[8]:https://bugs.gentoo.org/show_bug.cgi?id=416739 |
109 |
> |
110 |
>-- |
111 |
>Best regards, |
112 |
>Michał Górny |
113 |
><http://dev.gentoo.org/~mgorny/> |
114 |
|
115 |
-- |
116 |
NP-Hardass |