OPTFEATURE.ECLASS

Section: eclass-manpages (5)
Updated: Mar 2024
Index Return to Main Contents

NAME

optfeature.eclass - Advertise optional functionality that might be useful to users

SUPPORTED EAPIS

7 8

FUNCTIONS

optfeature_header [custom header for follow-up optfeature calls]
Set a custom header for follow-up optfeature calls, or reset to default header by calling it without argument. This can not only be used to customize the header but also to distinguish optfeature "groups", e.g. to list a number of different possible database backends, and then a number of optional regular runtime features.

The following snippet will leave the default header untouched for the first two optfeature calls. Then a custom header is set that is going to be displayed in case dev-db/a or dev-db/b are not installed.

pkg_postinst() {
        optfeature "foo support" app-misc/foo
        optfeature "bar support" app-misc/bar
        optfeature_header "Install optional database backends:"
        optfeature "a DB backend" dev-db/a
        optfeature "b DB backend" dev-db/b
}
optfeature <short description> <package atom to match> [other atoms]
Print out a message suggesting an optional package (or packages) not currently installed which provides the described functionality.

The following snippet would suggest app-misc/foo for optional foo support, app-misc/bar or app-misc/baz[bar] for optional bar support and either both app-misc/a and app-misc/b or app-misc/c for alphabet support.

pkg_postinst() {
        optfeature "foo support" app-misc/foo
        optfeature "bar support" app-misc/bar app-misc/baz[bar]
        optfeature "alphabet support" "app-misc/a app-misc/b" app-misc/c
}

MAINTAINERS

base-system@gentoo.org

REPORTING BUGS

Please report bugs via https://bugs.gentoo.org/

FILES

optfeature.eclass

SEE ALSO

ebuild(5)
https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/optfeature.eclass


Index

NAME
SUPPORTED EAPIS
FUNCTIONS
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:27:00 GMT, March 28, 2024