Skip to content

Commit

Permalink
Postrm script should not fail
Browse files Browse the repository at this point in the history
This commit changes the postrm script so that it prints error messages instead of failing & exiting when the deletion of a directory failed while removing a RPM/DEB package.

Closes #11373
  • Loading branch information
tlrx committed Jul 1, 2015
1 parent 8f1907f commit 737440b
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions core/src/packaging/common/scripts/postrm
Expand Up @@ -84,25 +84,22 @@ if [ "$REMOVE_DIRS" = "true" ]; then

if [ -d "$LOG_DIR" ]; then
echo -n "Deleting log directory..."
rm -rf "$LOG_DIR"
echo " OK"
rm -rf "$LOG_DIR" && echo " OK" || echo " ERROR: unable to delete directory [$LOG_DIR]"
fi

if [ -d "$PLUGINS_DIR" ]; then
echo -n "Deleting plugins directory..."
rm -rf "$PLUGINS_DIR"
echo " OK"
rm -rf "$PLUGINS_DIR" && echo " OK" || echo " ERROR: unable to delete directory [$PLUGINS_DIR]"
fi

if [ -d "$PID_DIR" ]; then
echo -n "Deleting PID directory..."
rm -rf "$PID_DIR"
echo " OK"
rm -rf "$PID_DIR" && echo " OK" || echo " ERROR: unable to delete directory [$PID_DIR]"
fi

# Delete the data directory if and only if empty
if [ -d "$DATA_DIR" ]; then
rmdir --ignore-fail-on-non-empty "$DATA_DIR"
rmdir --ignore-fail-on-non-empty "$DATA_DIR" && echo " OK" || echo " ERROR: unable to delete directory [$DATA_DIR]"
fi
fi

Expand Down

0 comments on commit 737440b

Please sign in to comment.