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 (3917B)


  1. From 206003c44dfb83008b9a890addcdb03ae9883414 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 cd2498358..83b3dbf30 100644
  14. --- a/config/ax_code_coverage.m4
  15. +++ b/config/ax_code_coverage.m4
  16. @@ -153,7 +153,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 529ab81dc..8cc36cf93 100644
  27. --- a/module/Makefile.in
  28. +++ b/module/Makefile.in
  29. @@ -73,7 +73,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. @@ -93,7 +93,7 @@ modules_install-Linux: modules_uninstall-Linux-legacy
  37. KERNELRELEASE=@LINUX_VERSION@
  38. @# Remove extraneous build products when packaging
  39. if [ -n "$(DESTDIR)" ]; 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 81ee87f8a..903d2856f 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. @@ -33,7 +33,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 157603981..cf60d03c5 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. @@ -61,7 +61,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 93355d0b3..88fc777e1 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. @@ -60,7 +60,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.44.0