logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0002-Use-find-exec-rm-instead-of-non-portable-delete.patch (3963B)


  1. From 57c4de31ce9e9ad76a47cf36f1c7aef0b380255f Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Tue, 17 Jan 2023 12:56:34 -0800
  4. Subject: [PATCH] Use find -exec rm instead of non-portable -delete
  5. ---
  6. config/ax_code_coverage.m4 | 2 +-
  7. module/Makefile.in | 4 ++--
  8. .../tests/functional/cli_root/zfs_diff/zfs_diff_timestamp.ksh | 2 +-
  9. .../tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh | 2 +-
  10. .../tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib | 2 +-
  11. 5 files changed, 6 insertions(+), 6 deletions(-)
  12. diff --git a/config/ax_code_coverage.m4 b/config/ax_code_coverage.m4
  13. index eb78a9d77..c82ee4efe 100644
  14. --- a/config/ax_code_coverage.m4
  15. +++ b/config/ax_code_coverage.m4
  16. @@ -154,7 +154,7 @@ distclean: code-coverage-clean
  17. code-coverage-clean:
  18. -$(LCOV) --directory $(top_builddir) -z
  19. -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY)
  20. - -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete
  21. + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -exec rm -- {} +
  22. ']
  23. ], [
  24. [CODE_COVERAGE_RULES_CHECK='
  25. diff --git a/module/Makefile.in b/module/Makefile.in
  26. index 859ba8649..6e55887f5 100644
  27. --- a/module/Makefile.in
  28. +++ b/module/Makefile.in
  29. @@ -74,7 +74,7 @@ clean-Linux:
  30. @CONFIG_KERNEL_TRUE@ $(MAKE) -C @LINUX_OBJ@ M="$$PWD" @KERNEL_MAKE@ clean
  31. $(RM) @LINUX_SYMBOLS@ Module.markers
  32. - find . -name '*.ur-safe' -type f -delete
  33. + find . -name '*.ur-safe' -type f -exec $(RM) -- {} +
  34. clean-FreeBSD:
  35. +$(FMAKE) clean
  36. @@ -95,7 +95,7 @@ modules_install-Linux: modules_uninstall-Linux-legacy
  37. KERNELRELEASE=@LINUX_VERSION@
  38. @# Remove extraneous build products when packaging
  39. if [ -n "$(DESTDIR)" ] && [ "$(DONT_DELETE_MODULES_FILES)" != "1" ]; then \
  40. - find $(KMODDIR) -name 'modules.*' -delete; \
  41. + find $(KMODDIR) -name 'modules.*' -exec $(RM) -- {} +; \
  42. fi
  43. @# Debian ships tiny fake System.map files that are
  44. @# syntactically valid but just say
  45. diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_timestamp.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_timestamp.ksh
  46. index 25dabfea2..39f3a8b7a 100755
  47. --- a/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_timestamp.ksh
  48. +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_diff/zfs_diff_timestamp.ksh
  49. @@ -34,7 +34,7 @@ function cleanup
  50. for snap in $TESTSNAP1 $TESTSNAP2; do
  51. snapexists "$snap" && destroy_dataset "$snap"
  52. done
  53. - find "$MNTPOINT" -type f -delete
  54. + find "$MNTPOINT" -type f -exec rm -- {} +
  55. rm -f "$FILEDIFF"
  56. }
  57. diff --git a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh
  58. index b14885425..7bf00a26b 100755
  59. --- a/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh
  60. +++ b/tests/zfs-tests/tests/functional/cli_root/zfs_send/zfs_send_007_pos.ksh
  61. @@ -62,7 +62,7 @@ function test_pool
  62. object=$(ls -i $mntpnt | awk '{print $1}')
  63. log_must zfs snapshot $POOL/fs@a
  64. while true; do
  65. - log_must find $mntpnt/ -type f -delete
  66. + log_must find $mntpnt/ -type f -exec rm -- {} +
  67. sync_all_pools
  68. log_must mkfiles "$mntpnt/" 4000
  69. sync_all_pools
  70. diff --git a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib
  71. index e305ce491..52608db7a 100644
  72. --- a/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib
  73. +++ b/tests/zfs-tests/tests/functional/zvol/zvol_misc/zvol_misc_common.kshlib
  74. @@ -61,7 +61,7 @@ function udev_cleanup
  75. udevadm settle
  76. # find all dangling links and delete them
  77. - find -L "${ZVOL_DEVDIR}" -type l -print -delete
  78. + find -L "${ZVOL_DEVDIR}" -type l -print -exec rm -- {} +
  79. # purge those links from udev database
  80. udevadm info --cleanup-db
  81. }
  82. --
  83. 2.49.0