Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 362291 - perl-module.eclass should not check whether src_configure() was already called
Summary: perl-module.eclass should not check whether src_configure() was already called
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Perl team
URL:
Whiteboard: scheduled for EAPI=6
Keywords:
Depends on:
Blocks: perl-eclass-6
  Show dependency tree
 
Reported: 2011-04-06 11:19 UTC by Michał Górny
Modified: 2015-12-19 22:07 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-04-06 11:19:57 UTC
Right now, perl-module.eclass sets internal SRC_PREP variable within perl-module_src_prep() to disallow preparing the sources twice. What is the motivation for this? I don't see a reason why an ebuild could call this function twice mistakenly.

Considering that this functions work in cwd and does not rely on absolute paths, there's no reason to not use it twice, e.g. to build two perl modules in a single ebuild. This is a case in net-im/ekg2 ebuild which (optionally) builds two related perl modules supplied with the program.

I suggest removing that check or stating a clear way to reuse the perl-module eclass functions to build multiple perl modules.
Comment 1 Torsten Veller (RETIRED) gentoo-dev 2011-04-06 11:52:53 UTC
http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/perl-module.eclass?r1=1.10&r2=1.11
"break up compile function, as we might need to patch the Makefile (CORBA-ORBit)"

You can set SRC_PREP="no" again. (net-firewall/psad does it -- ebuild seems to be a bit b0rked.)
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-04-06 12:06:29 UTC
(In reply to comment #1)
> http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/perl-module.eclass?r1=1.10&r2=1.11
> "break up compile function, as we might need to patch the Makefile
> (CORBA-ORBit)"

Looking at the diff, it seems that such an attempt is no longer necessary with EAPI 2+ (not to mention it's ugly).
Comment 3 Kent Fredric (IRC: kent\n) (RETIRED) gentoo-dev 2011-04-06 23:42:23 UTC
(In reply to comment #0)
> eclass functions to build multiple perl modules.

I would personally generally oppose the idea to build multiple perl modules within a single ebuild. It just seems like its being done wrong if somebody was actually doing that.

Granted there may be cases where its unavoidable, but that would be a last-option for me. I'd sooner ask for the package to be split into several separate ebuilds that all used one source archive than have one package install several different equivalent distributions itself.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2011-04-07 05:39:15 UTC
Well, that package no longer a case but the eclass and a few ebuilds still need cleaning up.

Some ebuilds, for example, unnecessarily call 'perl-module_src_prep' just before calling 'perl-module_src_compile'. And the current SRC_PREP behaviour helps with such an ugly tricks.
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2014-12-03 23:17:00 UTC
This type of change in behaviour should be changed with an EAPI update.
Comment 6 Andreas K. Hüttel archtester gentoo-dev 2014-12-13 21:38:29 UTC
The code from src_prep was moved to src_configure (including the block against double-calling) and all calls to src_prep in the tree replaced by src_configure.

src_prep will be removed. 

[Note, src_prep != src_prepare]

The block against double-calling remains for now, but I suggest we remove it in EAPI=6.
Comment 7 Andreas K. Hüttel archtester gentoo-dev 2015-12-05 21:19:48 UTC
Will die if called twice in EAPI=6
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-12-05 21:25:41 UTC
(In reply to Andreas K. Hüttel from comment #7)
> Will die if called twice in EAPI=6

Err, did you read this bug? Then please at least store the state per-directory rather than globally, since this explicitly prevents building two perl modules in one ebuild.
Comment 9 Andreas K. Hüttel archtester gentoo-dev 2015-12-05 21:38:40 UTC
(In reply to Michał Górny from comment #8)
> (In reply to Andreas K. Hüttel from comment #7)
> > Will die if called twice in EAPI=6
> 
> Err, did you read this bug? Then please at least store the state
> per-directory rather than globally, since this explicitly prevents building
> two perl modules in one ebuild.

OK fine then let's just ignore the condition silently instead.

I have no clue how much breaks if you run the phases twice though. 
Happy hacking everyone.
Comment 10 Andreas K. Hüttel archtester gentoo-dev 2015-12-19 22:07:10 UTC
This is fixed for EAPI=6 ebuilds.