Gentoo Development Guide

EUTILS.ECLASS

Section: portage (5)
Updated: Apr 2018
Index Return to Main Contents
 

NAME

eutils.eclass - many extra (but common) functions that are used in ebuilds  

DESCRIPTION

The eutils eclass contains a suite of functions that complement the ones that ebuild.sh already contain. The idea is that the functions are not required in all ebuilds but enough utilize them to have a common home rather than having multiple ebuilds implementing the same thing.

Due to the nature of this eclass, some functions may have maintainers different from the overall eclass!  

FUNCTIONS

eqawarn [message]
Proxy to ewarn for package managers that don't provide eqawarn and use the PM implementation if available. Reuses PORTAGE_ELOG_CLASSES as set by the dev profile.
emktemp [temp dir]
Cheap replacement for when debianutils (and thus mktemp) does not exist on the users system.
edos2unix <file> [more files ...]
A handy replacement for dos2unix, recode, fixdos, etc... This allows you to remove all of these text utilities from DEPEND variables because this is a script based solution. Just give it a list of files to convert and they will all be changed from the DOS CRLF format to the UNIX LF format.
strip-linguas [<allow LINGUAS>|<-i|-u> <directories of .po files>]
Make sure that LINGUAS only contains languages that a package can support. The first form allows you to specify a list of LINGUAS. The -i builds a list of po files found in all the directories and uses the intersection of the lists. The -u builds a list of po files found in all the directories and uses the union of the lists.
make_wrapper <wrapper> <target> [chdir] [libpaths] [installpath]
Create a shell wrapper script named wrapper in installpath (defaults to the bindir) to execute target (default of wrapper) by first optionally setting LD_LIBRARY_PATH to the colon-delimited libpaths followed by optionally changing directory to chdir.
path_exists [-a|-o] <paths>
Check if the specified paths exist. Works for all types of paths (files/dirs/etc...). The -a and -o flags control the requirements of the paths. They correspond to "and" and "or" logic. So the -a flag means all the paths must exist while the -o flag means at least one of the paths must exist. The default behavior is "and". If no paths are specified, then the return value is "false".
use_if_iuse <flag>
Return true if the given flag is in USE and IUSE.

Note that this function should not be used in the global scope.

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.

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
epause [seconds]
Sleep for the specified number of seconds (default of 5 seconds). Useful when printing a message the user should probably be reading and often used in conjunction with the ebeep function. If the EPAUSE_IGNORE env var is set, don't wait at all. Defined in EAPIs 0 1 and 2.
ebeep [number of beeps]
Issue the specified number of beeps (default of 5 beeps). Useful when printing a message the user should probably be reading and often used in conjunction with the epause function. If the EBEEP_IGNORE env var is set, don't beep at all. Defined in EAPIs 0 1 and 2.
usex <USE flag> [true output] [false output] [true suffix] [false suffix]
Proxy to declare usex for package managers or EAPIs that do not provide it and use the package manager implementation when available (i.e. EAPI >= 5). If USE flag is set, echo [true output][true suffix] (defaults to "yes"), otherwise echo [false output][false suffix] (defaults to "no").
einstalldocs
Install documentation using DOCS and HTML_DOCS, in EAPIs that do not provide this function. When available (i.e., in EAPI 6 or later), the package manager implementation should be used instead.

If DOCS is declared and non-empty, all files listed in it are installed. The files must exist, otherwise the function will fail. In EAPI 4 and 5, DOCS may specify directories as well; in earlier EAPIs using directories is unsupported.

If DOCS is not declared, the files matching patterns given in the default EAPI implementation of src_install will be installed. If this is undesired, DOCS can be set to empty value to prevent any documentation from being installed.

If HTML_DOCS is declared and non-empty, all files and/or directories listed in it are installed as HTML docs (using dohtml).

Both DOCS and HTML_DOCS can either be an array or a whitespace- separated list. Whenever directories are allowed, '<directory>/.' may be specified in order to install all files within the directory without creating a sub-directory in docdir.

Passing additional options to dodoc and dohtml is not supported. If you needed such a thing, you need to call those helpers explicitly.

in_iuse <flag>
Determines whether the given flag is in IUSE. Strips IUSE default prefixes as necessary. In EAPIs where it is available (i.e., EAPI 6 or later), the package manager implementation should be used instead.

Note that this function must not be used in the global scope.

 

MAINTAINERS

base-system@gentoo.org
 

REPORTING BUGS

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

FILES

eutils.eclass  

SEE ALSO

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


 

Index

NAME
DESCRIPTION
FUNCTIONS
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 03:25:02 GMT, April 26, 2018