That obviously isn't how it should have been done, but the real problem here is that the packaging system makes it too easy to do this in the first place.
If you use pre and post and preun and postun (rpm terminology) it almost always is a sign of a deficiency elsewhere, especially when run against files outside of your package's bailiwick.