1 |
On 12/29/2011 09:26 AM, Mike Gilbert wrote: |
2 |
> On 12/29/2011 09:06 AM, Michał Górny wrote: |
3 |
>> On Thu, 29 Dec 2011 08:50:11 -0500 |
4 |
>> Mike Gilbert <floppym@g.o> wrote: |
5 |
>> |
6 |
>>> On 12/29/2011 08:41 AM, Michał Górny wrote: |
7 |
>>>> On Thu, 29 Dec 2011 08:08:26 -0500 |
8 |
>>>> Mike Gilbert <floppym@g.o> wrote: |
9 |
>>>> |
10 |
>>>>> This patch allows python_mod_optimize to be used in cases where a |
11 |
>>>>> different set of python modules is installed depending on the |
12 |
>>>>> python abi. |
13 |
>>>>> |
14 |
>>>>> For example, dev-python/feedparse-5.1 (not yet in the tree) |
15 |
>>>>> installs the _feedparser_sgmllib.py module only in python-3*. |
16 |
>>>> |
17 |
>>>> Could you paste some example on how it is supposed to be used? |
18 |
>>>> |
19 |
>>> |
20 |
>>> Sure. Borrowed from feedparser-5.1.ebuild in Progress: |
21 |
>>> |
22 |
>>> pkg_postinst() { |
23 |
>>> python_mod_optimize -A "2.*" feedparser.py |
24 |
>>> python_mod_optimize -A "3.*" feedparser.py _feedparser_sgmllib.py |
25 |
>>> } |
26 |
>>> |
27 |
>>> pkg_postrm() { |
28 |
>>> python_mod_cleanup -A "2.*" feedparser.py |
29 |
>>> python_mod_cleanup -A "3.*" feedparser.py _feedparser_sgmllib.py |
30 |
>>> } |
31 |
>> |
32 |
>> Ok, now that I see it, I think you're inventing a really big hammer to |
33 |
>> get rid of a single mosquito. |
34 |
>> |
35 |
> |
36 |
> I don't think the hammer is really that big; it seems like a relatively |
37 |
> small extension to me. The code for checking ABI patterns is already |
38 |
> there, this just wires it up to a couple of additional functions. |
39 |
> |
40 |
> I actually think it would make more sense to call python_mod_optimize |
41 |
> using python_execute_function, but I think that would require a |
42 |
> backward-incompatible API change. |
43 |
> |
44 |
|
45 |
On second thought, most of python_mod_optimize could be refactored into |
46 |
a new function (python_mod_optimize_abi?) that would be called once per |
47 |
ABI by python_execute_function. So, please disregard that last comment. |
48 |
|
49 |
</tangent> |