From 9546d5635ed63faf1eaaf32d90a6b674922866f7 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Tue, 23 Jan 2024 10:31:30 -0500 Subject: [PATCH] Use consistent and less error-prone find rm's --- debian/pvc-client-cli.postinst | 2 +- debian/pvc-daemon-api.preinst | 2 +- debian/pvc-daemon-health.preinst | 4 ++-- debian/pvc-daemon-node.preinst | 2 +- debian/pvc-daemon-worker.preinst | 2 +- debian/rules | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/debian/pvc-client-cli.postinst b/debian/pvc-client-cli.postinst index d61943a8..52068731 100644 --- a/debian/pvc-client-cli.postinst +++ b/debian/pvc-client-cli.postinst @@ -6,6 +6,6 @@ if [ -d /etc/bash_completion.d ]; then fi # Remove pycaches -find /usr/lib/python3/dist-packages/pvc -name "__pycache__" -exec rm -r {} \; +find /usr/lib/python3/dist-packages/pvc -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true exit 0 diff --git a/debian/pvc-daemon-api.preinst b/debian/pvc-daemon-api.preinst index 3b05fd62..0f1fd534 100644 --- a/debian/pvc-daemon-api.preinst +++ b/debian/pvc-daemon-api.preinst @@ -2,4 +2,4 @@ # Remove any cached CPython directories or files echo "Cleaning up existing CPython files" -find /usr/share/pvc/pvcapid -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true +find /usr/share/pvc/pvcapid -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true diff --git a/debian/pvc-daemon-health.preinst b/debian/pvc-daemon-health.preinst index fe90f97b..7d954536 100644 --- a/debian/pvc-daemon-health.preinst +++ b/debian/pvc-daemon-health.preinst @@ -2,5 +2,5 @@ # Remove any cached CPython directories or files echo "Cleaning up existing CPython files" -find /usr/share/pvc/pvchealthd -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true -find /usr/share/pvc/plugins -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true +find /usr/share/pvc/pvchealthd -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true +find /usr/share/pvc/plugins -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true diff --git a/debian/pvc-daemon-node.preinst b/debian/pvc-daemon-node.preinst index b213c07d..e9e0ed24 100644 --- a/debian/pvc-daemon-node.preinst +++ b/debian/pvc-daemon-node.preinst @@ -2,4 +2,4 @@ # Remove any cached CPython directories or files echo "Cleaning up existing CPython files" -find /usr/share/pvc/pvcnoded -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true +find /usr/share/pvc/pvcnoded -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true diff --git a/debian/pvc-daemon-worker.preinst b/debian/pvc-daemon-worker.preinst index 93b5fce8..ad1f7cb7 100644 --- a/debian/pvc-daemon-worker.preinst +++ b/debian/pvc-daemon-worker.preinst @@ -2,4 +2,4 @@ # Remove any cached CPython directories or files echo "Cleaning up existing CPython files" -find /usr/share/pvc/pvcworkerd -type d -name "__pycache__" -exec rm -rf {} \; &>/dev/null || true +find /usr/share/pvc/pvcworkerd -type d -name "__pycache__" -exec rm -fr {} + &>/dev/null || true diff --git a/debian/rules b/debian/rules index 324582d7..cfdabe4d 100755 --- a/debian/rules +++ b/debian/rules @@ -13,7 +13,7 @@ override_dh_python3: rm -r $(CURDIR)/client-cli/.pybuild $(CURDIR)/client-cli/pvc.egg-info override_dh_auto_clean: - find . -name "__pycache__" -o -name ".pybuild" -exec rm -r {} \; || true + find . -name "__pycache__" -o -name ".pybuild" -exec rm -fr {} + || true # If you need to rebuild the Sphinx documentation # Add spinxdoc to the dh --with line