Skip to contentSkip to conversation

rm_work.bbclass: Fix for files starting with -

PATCH New William A. Kennington III 1 participant 1 message Sep 27, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rm_work.bbclass: Fix for files starting with -

This makes it possible to name files starting with a hyphen in the work directory. Without this change rm will fail due to an unexpected option being passed.

---
 meta/classes/rm_work.bbclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
meta/classes/rm_work.bbclass +4 -4
index 07901d7597..5f12d5aaeb 100644
@@ -73,7 +73,7 @@ do_rm_work () {
             # sstate version since otherwise we'd need to leave 'plaindirs' around
             # such as 'packages' and 'packages-split' and these can be large. No end
             # of chain tasks depend directly on do_package anymore.
-            rm -f $i;
+            rm -f -- $i;
             ;;
         *_setscene*)
             # Skip stamps which are already setscene versions
@@ -90,7 +90,7 @@ do_rm_work () {
                     ;;
                 esac
             done
-            rm -f $i
+            rm -f -- $i
         esac
     done
 
@@ -100,9 +100,9 @@ do_rm_work () {
         # 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
+            rm -rf -- $dir 2> /dev/null || true
         elif ! echo "$excludes" | grep -q -w "$dir"; then
-            rm -rf $dir
+            rm -rf -- $dir
         fi
     done
 }
Signature · 1 line
2.33.0.685.g46640cef36-goog