]> code.ossystems Code Review - openembedded-core.git/commitdiff
rm_work.bbclass: Fix for files starting with -
authorWilliam A. Kennington III <wak@google.com>
Mon, 27 Sep 2021 22:00:39 +0000 (15:00 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 28 Sep 2021 16:53:43 +0000 (17:53 +0100)
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.

Signed-off-by: William A. Kennington III <wak@google.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/rm_work.bbclass

index 07901d759726252f887545cb2ffab37d3e43dadd..5f12d5aaeb4d32b5044bfdcb74806ddd9673456a 100644 (file)
@@ -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
 }