See http://debathena.mit.edu/trac/ticket/388 for discussion. There are
more cases to think through here, but adding the deconfigure behavior is
correct and the most useful.
fi;) \
sed 's/#PACKAGE#/$(cdbs_curpkg)/g; s/#DEB_DIVERT_EXTENSION#/$(DEB_DIVERT_EXTENSION)/g' $(DEB_DIVERT_SCRIPT); \
$(if $(divert_files_thispkg), \
- echo 'if [ "$$1" = "remove" ]; then'; \
+ echo 'if [ "$$1" = "remove" ] || [ "$$1" = "deconfigure" ]; then'; \
$(foreach file,$(call reverse_dh_compat_6,$(divert_files)), \
echo " undivert_unlink $(call divert_files_replace_name,$(file), )";) \
$(foreach file,$(call reverse_dh_compat_6,$(divert_remove_files)), \