public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCHES] distutils-r1: support 'edefault' in sub-phase functions
@ 2013-05-01 20:42 Michał Górny
  2013-05-01 20:42 ` [gentoo-dev] [PATCH 1/2] Introduce edefault() as a friendly default sub-phase wrapper Michał Górny
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Michał Górny @ 2013-05-01 20:42 UTC (permalink / raw
  To: gentoo-dev; +Cc: python

[-- Attachment #1: Type: text/plain, Size: 1290 bytes --]

Hi, everyone.

This one goes to gentoo-dev since it's a potentially wider idea
and I'd like to get other developers opinion on.

As you most likely already know, distutils-r1 allows ebuilds to define
sub-phase functions like:

  python_compile() {
    # commands which will be run for each impl
    do_something_magical
  }

Often, ebuilds do not want to override the sub-phases completely
but instead call the default implementation:

  python_install_all() {
    use doc && local HTML_DOCS=( doc/html/. )
    distutils-r1_python_install_all
  }

So the behavior is quite similar to the regular phase functions.
However, the function names ended up quite verbose.

To make this more friendly, I would likely to locally introduce
'edefault' function in the eclass (name can change). The function would
-- similarly to 'default' in regular phase functions -- call
the default code for the sub-phase.

For example, the above would change to:

  python_install_all() {
    use doc && local HTML_DOCS=( doc/html/. )
    edefault
  }

I will send in reply a patch adding the described magic to the eclass,
and a second one showing how an example ebuild can be changed
(dev-python/setuptools).

What are your thoughts?

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-05-15 19:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-01 20:42 [gentoo-dev] [PATCHES] distutils-r1: support 'edefault' in sub-phase functions Michał Górny
2013-05-01 20:42 ` [gentoo-dev] [PATCH 1/2] Introduce edefault() as a friendly default sub-phase wrapper Michał Górny
2013-05-11  9:30   ` [gentoo-dev] [PATCH FIXED] " Michał Górny
2013-05-11 15:51     ` [gentoo-dev] " Mike Gilbert
2013-05-11 16:35       ` Michał Górny
2013-05-11 16:41       ` Ralph Sennhauser
2013-05-01 20:42 ` [gentoo-dev] [PATCH 2/2] Example use of edefault Michał Górny
2013-05-15 19:03 ` [gentoo-dev] [PATCHES] distutils-r1: support 'edefault' in sub-phase functions Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox