Skip to content

Detect "shadowed" pkg_{setup,pretend} phases #377

@thesamesam

Description

@thesamesam

This is mostly an issue with pkg_{setup,pretend,postinst} but it affects other phase functions too.

For example, xdg.eclass exports a xdg_pkg_postinst, but if one has...

EAPI=8

inherit optfeature xdg

pkg_postinst() {
	optfeature "Foo support" dev-libs/foo
}

... then xdg_pkg_postinst is never called, which may be because the developer didn't realise xdg even exported a pkg_postinst.

This is arguably more of a problem with things like fortran-2.eclass where we might often have to define pkg_setup to check for OpenMP support, but then forget to call fortran-2_pkg_setup (example modified from sci-libs/lis/lis-1.6.5.ebuild:

EAPI=8

inherit toolchain-funcs fortran-2

pkg_pretend() {
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
}

pkg_setup() {[
    # (Dropped fortran-2_pkg_setup from original ebuild for purposes of example)
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp && FORTRAN_NEED_OPENMP=1
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions