Przeglądaj źródła

Have `make clean` remove directories as well

But apply at least minimal safeguards from running `rm -rf /` or
similar catastrophic cases.
Alois Mahdal 9 lat temu
rodzic
commit
263c0b37b1
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2
    1
      src/include/build.sh

+ 2
- 1
src/include/build.sh Wyświetl plik

@@ -77,7 +77,8 @@ clean() {
77 77
     # Clean up tree after building
78 78
     #
79 79
     test -f "$MKIT_LOCAL/built.lst" && {
80
-        <"$MKIT_LOCAL/built.lst" xargs -r rm -f
80
+        <"$MKIT_LOCAL/built.lst" grep -v -e '\.\.' -e ^/ \
81
+          | xargs -r rm -rf
81 82
         rm -f "$MKIT_LOCAL/built.lst"
82 83
         rmdir --ignore-fail-on-non-empty "$MKIT_LOCAL"
83 84
     }