Summary: | dev-util/pkgcheck: should check for double definition of a phase function | ||
---|---|---|---|
Product: | Gentoo Hosted Projects | Reporter: | Justin Lecher (RETIRED) <jlec> |
Component: | PkgCore | Assignee: | PkgCore project <pkgcore> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | mgorny, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: |
https://bugs.gentoo.org/show_bug.cgi?id=610764 https://github.com/pkgcore/pkgcheck/issues/624 |
||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Justin Lecher (RETIRED)
2011-05-02 09:43:35 UTC
this might be hard to do. valid ebuild: if ...... src_compile() { ..... } else src_compile() { ..... } fi That's right. I just found an ebuild which had src_install() { ...} ... src_install() {...} That's where my idea came from. (In reply to comment #0) > Repoman should cry if a phase function is defined twice inside the ebuild I'm not sure if it's worth adding a check for stuff like this. (In reply to comment #1) > this might be hard to do. valid ebuild: > if ...... > src_compile() { > ..... > } > else > src_compile() { > ..... > } > fi If we assume that the functions would be indented in this case, then it's easy. Otherwise, not so easy, and not really worth the effort. It seems like a questionable practice though anyway. Why not just put the if/else inside the function? the funcs would not be indented. if the if statement is checking PV, and the funcs share no common code, then i dont see any harm in it. repoman support has been removed per bug 835013. Please file a new bug (or, I suppose, reopen this one) if you feel this check is still applicable to pkgcheck and doesn't already exist. I don't think pkgcheck does this right now. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=8abeb154ed6047cd730ceb242a2fa08a486f739f commit 8abeb154ed6047cd730ceb242a2fa08a486f739f Author: Arthur Zamarin <arthurzam@gentoo.org> AuthorDate: 2023-09-19 18:09:54 +0000 Commit: Arthur Zamarin <arthurzam@gentoo.org> CommitDate: 2023-09-23 15:36:03 +0000 DuplicateFunctionDefinition: new check for duplicate global functions Closes: https://bugs.gentoo.org/365691 Resolves: https://github.com/pkgcore/pkgcheck/issues/624 Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org> src/pkgcheck/checks/codingstyle.py | 28 ++++++++++++++++++---- .../DuplicateFunctionDefinition/expected.json | 2 ++ .../DuplicateFunctionDefinition-0.ebuild | 21 ++++++++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) |