1 |
On 12/29/2011 09:06 AM, Michał Górny wrote: |
2 |
> On Thu, 29 Dec 2011 08:50:11 -0500 |
3 |
> Mike Gilbert <floppym@g.o> wrote: |
4 |
> |
5 |
>> On 12/29/2011 08:41 AM, Michał Górny wrote: |
6 |
>>> On Thu, 29 Dec 2011 08:08:26 -0500 |
7 |
>>> Mike Gilbert <floppym@g.o> wrote: |
8 |
>>> |
9 |
>>>> This patch allows python_mod_optimize to be used in cases where a |
10 |
>>>> different set of python modules is installed depending on the |
11 |
>>>> python abi. |
12 |
>>>> |
13 |
>>>> For example, dev-python/feedparse-5.1 (not yet in the tree) |
14 |
>>>> installs the _feedparser_sgmllib.py module only in python-3*. |
15 |
>>> |
16 |
>>> Could you paste some example on how it is supposed to be used? |
17 |
>>> |
18 |
>> |
19 |
>> Sure. Borrowed from feedparser-5.1.ebuild in Progress: |
20 |
>> |
21 |
>> pkg_postinst() { |
22 |
>> python_mod_optimize -A "2.*" feedparser.py |
23 |
>> python_mod_optimize -A "3.*" feedparser.py _feedparser_sgmllib.py |
24 |
>> } |
25 |
>> |
26 |
>> pkg_postrm() { |
27 |
>> python_mod_cleanup -A "2.*" feedparser.py |
28 |
>> python_mod_cleanup -A "3.*" feedparser.py _feedparser_sgmllib.py |
29 |
>> } |
30 |
> |
31 |
> Ok, now that I see it, I think you're inventing a really big hammer to |
32 |
> get rid of a single mosquito. |
33 |
> |
34 |
|
35 |
I don't think the hammer is really that big; it seems like a relatively |
36 |
small extension to me. The code for checking ABI patterns is already |
37 |
there, this just wires it up to a couple of additional functions. |
38 |
|
39 |
I actually think it would make more sense to call python_mod_optimize |
40 |
using python_execute_function, but I think that would require a |
41 |
backward-incompatible API change. |
42 |
|
43 |
> On the other hand, I don't think I can think of a good per-ebuild way |
44 |
> to handle this. I'd rather start by pinging upstream not to pollute |
45 |
> global namespace and install a package instead; even if it supposed to |
46 |
> contain __init__.py only. |
47 |
> |
48 |
|
49 |
That would take care of this specific package, yes. However, I still |
50 |
think it would be nice to have a workaround available. |