src_unpack
| Function | src_unpack |
|---|---|
| Purpose | Extract source packages. |
| Sandbox | Enabled |
| Privilege | user |
| Called for | ebuild |
Unpacking tarballs
The unpack function should be used to unpack tarballs, compressed
files and so on. Do not use tar, gunzip etc. manually.
The ${A} variable contains all of the SRC_URI components, except
for any which are excluded by USE-based conditionals inside SRC_URI
itself. If multiple archives require unpacking in a particular order it is
usually simpler to avoid working with ${A}.
Known file formats
The unpack function recognizes the following file formats:
*.tar-
*.gz,*.Z,*.tar.gz,*.tgz,*.tar.Z -
*.bz2,*.bz,*.tar.bz2,*.tbz2,*.tar.bz,*.tbz -
*.lzma,*.tar.lzma -
*.xz,*.tar.xz,*.txz -
*.zip,*.ZIP,*.jar -
*.a,*.deb
Filename extensions are matched case-insensitively.
Support for the 7-Zip (*.7z), LHA (*.lha, *.lzh) and
RAR (*.rar) formats was removed in EAPI 8. Packages distributing such
archives have to unpack them by other means, for which
unpacker.eclass is recommended.
An argument that contains no slash names a file in ${DISTDIR}. Any other
argument is treated as a path, which may be absolute or relative to the current
working directory, and needs no leading ./:
unpack sub/dir/${P}-docs.tar.gz
${DISTDIR} for files that are listed in
SRC_URI — write unpack ${P}.tar.gz rather than
unpack "${DISTDIR}"/${P}.tar.gz. The latter is redundant and the package
manager may warn about it.
BDEPEND) for it.