summaryrefslogtreecommitdiffstats
path: root/meta/classes/rm_work.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/rm_work.bbclass')
-rw-r--r--meta/classes/rm_work.bbclass15
1 files changed, 11 insertions, 4 deletions
diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass
index 8979714e62..f7ededff26 100644
--- a/meta/classes/rm_work.bbclass
+++ b/meta/classes/rm_work.bbclass
@@ -27,6 +27,13 @@ BB_SCHEDULER ?= "completion"
27BB_TASK_IONICE_LEVEL:task-rm_work = "3.0" 27BB_TASK_IONICE_LEVEL:task-rm_work = "3.0"
28 28
29do_rm_work () { 29do_rm_work () {
30 # Force using the HOSTTOOLS 'rm' - otherwise the SYSROOT_NATIVE 'rm' can be selected depending on PATH
31 # Avoids race-condition accessing 'rm' when deleting WORKDIR folders at the end of this function
32 RM_BIN="$(PATH=${HOSTTOOLS_DIR} command -v rm)"
33 if [ -z "${RM_BIN}" ]; then
34 bbfatal "Binary 'rm' not found in HOSTTOOLS_DIR, cannot remove WORKDIR data."
35 fi
36
30 # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe. 37 # If the recipe name is in the RM_WORK_EXCLUDE, skip the recipe.
31 for p in ${RM_WORK_EXCLUDE}; do 38 for p in ${RM_WORK_EXCLUDE}; do
32 if [ "$p" = "${PN}" ]; then 39 if [ "$p" = "${PN}" ]; then
@@ -73,7 +80,7 @@ do_rm_work () {
73 # sstate version since otherwise we'd need to leave 'plaindirs' around 80 # sstate version since otherwise we'd need to leave 'plaindirs' around
74 # such as 'packages' and 'packages-split' and these can be large. No end 81 # such as 'packages' and 'packages-split' and these can be large. No end
75 # of chain tasks depend directly on do_package anymore. 82 # of chain tasks depend directly on do_package anymore.
76 rm -f -- $i; 83 "${RM_BIN}" -f -- $i;
77 ;; 84 ;;
78 *_setscene*) 85 *_setscene*)
79 # Skip stamps which are already setscene versions 86 # Skip stamps which are already setscene versions
@@ -90,7 +97,7 @@ do_rm_work () {
90 ;; 97 ;;
91 esac 98 esac
92 done 99 done
93 rm -f -- $i 100 "${RM_BIN}" -f -- $i
94 esac 101 esac
95 done 102 done
96 103
@@ -100,9 +107,9 @@ do_rm_work () {
100 # Retain only logs and other files in temp, safely ignore 107 # Retain only logs and other files in temp, safely ignore
101 # failures of removing pseudo folers on NFS2/3 server. 108 # failures of removing pseudo folers on NFS2/3 server.
102 if [ $dir = 'pseudo' ]; then 109 if [ $dir = 'pseudo' ]; then
103 rm -rf -- $dir 2> /dev/null || true 110 "${RM_BIN}" -rf -- $dir 2> /dev/null || true
104 elif ! echo "$excludes" | grep -q -w "$dir"; then 111 elif ! echo "$excludes" | grep -q -w "$dir"; then
105 rm -rf -- $dir 112 "${RM_BIN}" -rf -- $dir
106 fi 113 fi
107 done 114 done
108} 115}