diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-30 15:59:34 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-07-31 14:25:44 +0100 |
commit | bf8b9858d9ccce27173d13938a83d249294cc473 (patch) | |
tree | 238fc8e2f6cde75f743fe16dbc1a1a45e59cf62c /meta/classes | |
parent | a649f3da630e8ca2d3ca58b610f3918720dd5229 (diff) | |
download | openembedded-core-contrib-bf8b9858d9ccce27173d13938a83d249294cc473.tar.gz |
rm_work: Improve handling for addto_recipe_sysroot
Rather than requiring each user to handle this individually, handle
addto_recipe_sysroot in the core class. As well as preserving the
sysroot directory, this also ensures the stamp is preserved rather
than rerunning the task every time as currently happens.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/rm_work.bbclass | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass index badeaeba07..2a4e808b88 100644 --- a/meta/classes/rm_work.bbclass +++ b/meta/classes/rm_work.bbclass @@ -35,22 +35,12 @@ do_rm_work () { fi done - cd ${WORKDIR} - for dir in * - do - # Retain only logs and other files in temp, safely ignore - # failures of removing pseudo folers on NFS2/3 server. - if [ $dir = 'pseudo' ]; then - rm -rf $dir 2> /dev/null || true - elif ! echo '${RM_WORK_EXCLUDE_ITEMS}' | grep -q -w "$dir"; then - rm -rf $dir - fi - done - # Need to add pseudo back or subsqeuent work in this workdir # might fail since setscene may not rerun to recreate it mkdir -p ${WORKDIR}/pseudo/ + excludes='${RM_WORK_EXCLUDE_ITEMS}' + # Change normal stamps into setscene stamps as they better reflect the # fact WORKDIR is now empty # Also leave noexec stamps since setscene stamps don't cover them @@ -79,6 +69,12 @@ do_rm_work () { i=dummy break ;; + *do_addto_recipe_sysroot*) + # Preserve recipe-sysroot-native if do_addto_recipe_sysroot has been used + excludes="$excludes recipe-sysroot-native" + i=dummy + break + ;; # We remove do_package entirely, including any # sstate version since otherwise we'd need to leave 'plaindirs' around # such as 'packages' and 'packages-split' and these can be large. No end @@ -101,6 +97,18 @@ do_rm_work () { done rm -f $i done + + cd ${WORKDIR} + for dir in * + do + # Retain only logs and other files in temp, safely ignore + # failures of removing pseudo folers on NFS2/3 server. + if [ $dir = 'pseudo' ]; then + rm -rf $dir 2> /dev/null || true + elif ! echo "$excludes" | grep -q -w "$dir"; then + rm -rf $dir + fi + done } do_rm_work_all () { : |