optfeature.eclass

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
}

Reporting Bugs

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