Skip to contentSkip to conversation

rm_work: Allow pseudo directory to be in the excludes

PATCH In review Jan-Simon Möller 2 participants 2 messages Oct 3, 2020 – Oct 4, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rm_work: Allow pseudo directory to be in the excludes

From: Jan-Simon Möller <[email protected]>

While debugging the pseudo issues, rm_work was always removing the pseudo folder even when it was in the RM_WORK_EXCLUDE_ITEMS variable.

This patch puts the pseudo case within the conditional.

---
 meta/classes/rm_work.bbclass | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
meta/classes/rm_work.bbclass +6 -4
index 01c2ab1c78..0e52fb6ae6 100644
@@ -99,10 +99,12 @@ do_rm_work () {
     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
+        if ! echo "$excludes" | grep -q -w "$dir"; then
+            if [ $dir = 'pseudo' ]; then
+                rm -rf $dir 2> /dev/null || true
+            else
+                rm -rf $dir
+            fi
         fi
     done
 }

--
2.26.2

#1 lore raw
Quoted 7 lines · Jan-Simon Möller

From: Jan-Simon Möller <[email protected]>

While debugging the pseudo issues, rm_work was always removing the pseudo folder
even when it was in the RM_WORK_EXCLUDE_ITEMS variable.

This patch puts the pseudo case within the conditional.

I've mixed feelings on this. Given the things rm_work removes, it has to remove the pseudo database as well or you will get path mismatch errors. I suspect we intentionally don't let the user do this.

Have you had this running without issues?

Cheers,

Richard