epatch.eclass
Description
An eclass providing epatch
and epatch_user
functions to easily apply
patches to ebuilds. Mostly superseded by eapply*
in EAPI 6.
Functions
- epatch [options] [patches] [dirs of patches]
-
epatch
is designed to greatly simplify the application of patches. It can process patch files directly, or directories of patches. The patches may be compressed (bzip/gzip/etc...) or plain text. You generally need not specify the-p
option asepatch
will automatically attempt-p0
to-p4
until things apply successfully.If you do not specify any patches/dirs, then
epatch
will default to the directory specified byEPATCH_SOURCE
.Any options specified that start with a dash will be passed down to patch for this specific invocation. As soon as an arg w/out a dash is found, then arg processing stops.
When processing directories,
epatch
will apply all patches that match:if ${EPATCH_FORCE} != "yes" ??_${ARCH}_foo.${EPATCH_SUFFIX} else *.${EPATCH_SUFFIX}
The leading
??
are typically numbers used to force consistent patch ordering. The arch field is used to apply patches only for the host architecture with the special value ofall
means apply for everyone. Note that using values other thanall
is highly discouraged -- you should apply patches all the time and let architecture details be detected at configure/compile time.If
EPATCH_SUFFIX
is empty, then no period before it is implied when searching for patches to apply.Refer to the other
EPATCH_xxx
variables for more customization of behavior.
Function Variables
- EPATCH_SOURCE
-
Default directory to search for patches.
- EPATCH_SUFFIX
-
Default extension for patches (do not prefix the period yourself).
- EPATCH_OPTS
-
Options to pass to patch. Meant for ebuild/package-specific tweaking such as forcing the patch level (
-p#
) or fuzz (-F#
) factor. Note that for single patch tweaking, you can also pass flags directly toepatch
. - EPATCH_COMMON_OPTS
-
Common options to pass to
patch
. You probably should never need to change these. If you do, please discuss it with base-system first to be sure.-g0 - keep RCS, ClearCase, Perforce and SCCS happy #24571 --no-backup-if-mismatch - do not leave .orig files behind -E - automatically remove empty files
- EPATCH_EXCLUDE
-
List of patches not to apply. Note this is only file names, and not the full path. Globs accepted.
- EPATCH_MULTI_MSG
-
Change the printed message for multiple patches.
- EPATCH_FORCE
-
Only require patches to match
EPATCH_SUFFIX
rather than the extended arch naming style. - EPATCH_USER_EXCLUDE
-
List of patches not to apply. Note this is only file names, and not the full path. Globs accepted.
Reporting Bugs
Please report bugs via https://bugs.gentoo.org/