summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-30 15:59:34 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-07-31 15:13:31 +0100
commit35e3cb3012d79f62da03f0e1dc592ee45759edea (patch)
tree8aaf2cbdbcec3fe272ca73430c84ba22bb955e66 /meta/classes
parent4f9918ccfada2efb4fa89385795eac6d917b5fe1 (diff)
downloadpoky-35e3cb3012d79f62da03f0e1dc592ee45759edea.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. (From OE-Core rev: bf8b9858d9ccce27173d13938a83d249294cc473) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/rm_work.bbclass32
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 () {
35 fi 35 fi
36 done 36 done
37 37
38 cd ${WORKDIR}
39 for dir in *
40 do
41 # Retain only logs and other files in temp, safely ignore
42 # failures of removing pseudo folers on NFS2/3 server.
43 if [ $dir = 'pseudo' ]; then
44 rm -rf $dir 2> /dev/null || true
45 elif ! echo '${RM_WORK_EXCLUDE_ITEMS}' | grep -q -w "$dir"; then
46 rm -rf $dir
47 fi
48 done
49
50 # Need to add pseudo back or subsqeuent work in this workdir 38 # Need to add pseudo back or subsqeuent work in this workdir
51 # might fail since setscene may not rerun to recreate it 39 # might fail since setscene may not rerun to recreate it
52 mkdir -p ${WORKDIR}/pseudo/ 40 mkdir -p ${WORKDIR}/pseudo/
53 41
42 excludes='${RM_WORK_EXCLUDE_ITEMS}'
43
54 # Change normal stamps into setscene stamps as they better reflect the 44 # Change normal stamps into setscene stamps as they better reflect the
55 # fact WORKDIR is now empty 45 # fact WORKDIR is now empty
56 # Also leave noexec stamps since setscene stamps don't cover them 46 # Also leave noexec stamps since setscene stamps don't cover them
@@ -79,6 +69,12 @@ do_rm_work () {
79 i=dummy 69 i=dummy
80 break 70 break
81 ;; 71 ;;
72 *do_addto_recipe_sysroot*)
73 # Preserve recipe-sysroot-native if do_addto_recipe_sysroot has been used
74 excludes="$excludes recipe-sysroot-native"
75 i=dummy
76 break
77 ;;
82 # We remove do_package entirely, including any 78 # We remove do_package entirely, including any
83 # sstate version since otherwise we'd need to leave 'plaindirs' around 79 # sstate version since otherwise we'd need to leave 'plaindirs' around
84 # such as 'packages' and 'packages-split' and these can be large. No end 80 # such as 'packages' and 'packages-split' and these can be large. No end
@@ -101,6 +97,18 @@ do_rm_work () {
101 done 97 done
102 rm -f $i 98 rm -f $i
103 done 99 done
100
101 cd ${WORKDIR}
102 for dir in *
103 do
104 # Retain only logs and other files in temp, safely ignore
105 # failures of removing pseudo folers on NFS2/3 server.
106 if [ $dir = 'pseudo' ]; then
107 rm -rf $dir 2> /dev/null || true
108 elif ! echo "$excludes" | grep -q -w "$dir"; then
109 rm -rf $dir
110 fi
111 done
104} 112}
105do_rm_work_all () { 113do_rm_work_all () {
106 : 114 :