]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
rm_work: Improve handling for addto_recipe_sysroot
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 30 Jul 2017 14:59:34 +0000 (15:59 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 31 Jul 2017 14:13:31 +0000 (15:13 +0100)
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>
meta/classes/rm_work.bbclass
meta/recipes-devtools/qemu/qemu-helper-native_1.0.bb
meta/recipes-kernel/systemtap/systemtap-native_git.bb

index badeaeba07c1286062ff667b3c5caf4227f8d504..2a4e808b88b7c010b1f4a49eb39d0cd9ed933967 100644 (file)
@@ -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 () {
     :
index 27d53157db120003b62b9c4beaf0467e60b2719b..d86b15517626ffa02eb8022d08c3f6598b1ff26a 100644 (file)
@@ -20,6 +20,5 @@ do_install() {
        install tunctl ${D}${bindir}/
 }
 
-RM_WORK_EXCLUDE_ITEMS += "recipe-sysroot-native"
 DEPENDS += "qemu-native"
 addtask addto_recipe_sysroot after do_populate_sysroot before do_build
index c3da77c8314d1df7199cc911ffe6e18d476a223b..19cc1cf0f0aefad1d7f055eeac15ae09f917dd6f 100644 (file)
@@ -3,5 +3,4 @@ require systemtap_git.bb
 
 inherit native
 
-RM_WORK_EXCLUDE_ITEMS += "recipe-sysroot-native"
 addtask addto_recipe_sysroot after do_populate_sysroot before do_build