summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/classes/rm_work_and_downloads.bbclass33
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/classes/rm_work_and_downloads.bbclass b/meta/classes/rm_work_and_downloads.bbclass
new file mode 100644
index 0000000000..7c00bea597
--- /dev/null
+++ b/meta/classes/rm_work_and_downloads.bbclass
@@ -0,0 +1,33 @@
1# Author: Patrick Ohly <patrick.ohly@intel.com>
2# Copyright: Copyright (C) 2015 Intel Corporation
3#
4# This file is licensed under the MIT license, see COPYING.MIT in
5# this source distribution for the terms.
6
7# This class is used like rm_work:
8# INHERIT += "rm_work_and_downloads"
9#
10# In addition to removing local build directories of a recipe, it also
11# removes the downloaded source. This is achieved by making the DL_DIR
12# recipe-specific. While reducing disk usage, it increases network usage (for
13# example, compiling the same source for target and host implies downloading
14# the source twice).
15#
16# Because the "do_fetch" task does not get re-run after removing the downloaded
17# sources, this class is also not suitable for incremental builds.
18#
19# Where it works well is in well-connected build environments with limited
20# disk space (like TravisCI).
21
22inherit rm_work
23
24# This would ensure that the existing do_rm_work() removes the downloads,
25# but does not work because some recipes have a circular dependency between
26# WORKDIR and DL_DIR (via ${SRCPV}?).
27# DL_DIR = "${WORKDIR}/downloads"
28
29# Instead go up one level and remove ourself.
30DL_DIR = "${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}/${PN}/downloads"
31do_rm_work_append () {
32 rm -rf ${DL_DIR}
33}