piuparts purges openssl first, which leaves `/etc/ssl/certs' on the
system. There was already a workaround for #454334 in place, but this
only covered `/etc/ssl', which was not removable due to `/etc/ssl/certs'
still in place.
purge)
rm -f /etc/ssl/certs/ca-certificates.crt*
- # Fix for #454334
- rmdir --ignore-fail-on-non-empty /etc/ssl
+
+ # Clean up even if openssl is removed before ca-certificates.
+ # (Which is what piuparts does.)
+ [ -d /etc/ssl/certs ] && rmdir --ignore-fail-on-non-empty /etc/ssl/certs
+ [ -d /etc/ssl ] && rmdir --ignore-fail-on-non-empty /etc/ssl
+
rm -f /etc/ca-certificates.conf*
if test -e /usr/share/debconf/confmodule; then
. /usr/share/debconf/confmodule