diff options
author | Florian Schmaus <flow@gentoo.org> | 2024-03-06 21:52:08 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2024-03-09 18:46:00 +0000 |
commit | 8eb2502bf264d54dfbf180222f162f7a593b947d (patch) | |
tree | fddb7d9d74bb672f88f194885215093a7e298728 /bin | |
parent | meson.build: Install dist-info METADATA (diff) | |
download | portage-8eb2502bf264d54dfbf180222f162f7a593b947d.tar.gz portage-8eb2502bf264d54dfbf180222f162f7a593b947d.tar.bz2 portage-8eb2502bf264d54dfbf180222f162f7a593b947d.zip |
phase-functions: prematurely delete WORKDIR if FEATURES=merge-wait
Using the merge-wait feature together with many parallel emerge jobs
potentially leads to a high disk space usage due to the created
portage build directories waiting for their packages to be merged into
the live filesystem prior portage will clean them. This can easily
lead to out-of-space errors.
Prematurely deleting WORKDIR at the end of src_install() helps
reducing the temporarily used disk space. All that portage need to
merge a package into the live filesystem are the files in the image/
directory (D). (At least in theory)
Signed-off-by: Florian Schmaus <flow@gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1302
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'bin')
-rw-r--r-- | bin/phase-functions.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh index ebcf5f242..ab130a3be 100644 --- a/bin/phase-functions.sh +++ b/bin/phase-functions.sh @@ -723,6 +723,13 @@ __dyn_install() { >> DEBUGBUILD fi trap - SIGINT SIGQUIT + + # Prematurely delete WORKDIR in case merge-wait is enabled to + # decrease the space used by portage build directories until the + # packages are merged and cleaned. + if has merge-wait ${FEATURES} && ! has keepwork ${FEATURES}; then + rm -rf "${WORKDIR}" + fi } __dyn_help() { |