[PATCH] D148555: [arcanist] rm -f for write protected temp files

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 17 11:41:17 PDT 2023


nickdesaulniers created this revision.
nickdesaulniers added a reviewer: MaskRay.
Herald added a project: All.
nickdesaulniers requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When running `arc diff` on a newly added file,
utils/arcanist/clang-format.sh is run. For new files there is no change,
but the script will bail. Without the use of the -f flag, we get
interactive prompts like:
rm: remove write-protected regular file '/tmp/tmp.ReMybrBw35'?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148555

Files:
  utils/arcanist/clang-format.sh


Index: utils/arcanist/clang-format.sh
===================================================================
--- utils/arcanist/clang-format.sh
+++ utils/arcanist/clang-format.sh
@@ -36,7 +36,7 @@
 
 cleanup() {
   rc=$?
-  rm "${formatted_file}" "${original_file}"
+  rm -f "${formatted_file}" "${original_file}"
   exit ${rc}
 }
 trap 'cleanup' INT HUP QUIT TERM EXIT


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148555.514340.patch
Type: text/x-patch
Size: 367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230417/00c16cf7/attachment.bin>


More information about the llvm-commits mailing list