pkgcore / pkgcheck

pkgcore-based QA utility for ebuild repos
https://pkgcore.github.io/pkgcheck
BSD 3-Clause "New" or "Revised" License
34 stars 29 forks source link

[New Check]: Detect duplicate phase definitions #624

Closed thesamesam closed 9 months ago

thesamesam commented 9 months ago

Is there an existing such new check request for this?

Explain

It is invalid for the same phase to be repeatedly defined within an ebuild. It's not even clear to me which definition should win, let alone it being an obvious error.

Please note this is different to https://github.com/pkgcore/pkgcheck/issues/377, so maybe we shouldn't say 'shadowed' for this new bug, and just say 'duplicate'.

Examples

See the https://bugs.gentoo.org/610764 tracker on Bugzilla.

runit-2.1.2-r1 has two copies of pkg_preinst (https://bugs.gentoo.org/862615), see https://github.com/gentoo/gentoo/blob/4cbefaa399931045a800c6973faf37955a15fdbc/sys-process/runit/runit-2.1.2-r1.ebuild#L76.

Output message

DuplicatePhaseDefinition

Documentation

Multiple definitions of an ebuild phase were found.

Result level

error

thesamesam commented 9 months ago

Ah, we have a bug for this already but on Bugzilla: https://bugs.gentoo.org/365691.