postinst logic improvement