From 14175a72a57cf4536bd5220222e094cca9c17b5b Mon Sep 17 00:00:00 2001 From: EvgeniyPatlan Date: Fri, 8 Aug 2025 15:14:51 +0300 Subject: [PATCH] Fix postrm script to properly handle directory removal - Check if /usr/lib/mysqlsh exists before attempting removal - Verify rm command success and provide accurate feedback - Send error messages to stderr with proper warning format - Inform user when directory doesn't exist instead of silent operation --- packaging/debian/postrm.in | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packaging/debian/postrm.in b/packaging/debian/postrm.in index 4a1979f23a..850772e6cf 100644 --- a/packaging/debian/postrm.in +++ b/packaging/debian/postrm.in @@ -24,8 +24,15 @@ set -e if [ "$1" = "purge" ]; then - rm -rf /usr/lib/mysqlsh 2>/dev/null - echo "Deleted /usr/lib/mysqlsh" + if [ -d "/usr/lib/mysqlsh" ]; then + if rm -rf /usr/lib/mysqlsh; then + echo "Successfully deleted /usr/lib/mysqlsh" + else + echo "Warning: Failed to delete /usr/lib/mysqlsh" >&2 + fi + else + echo "Directory /usr/lib/mysqlsh does not exist, nothing to remove" + fi fi #DEBHELPER#