If I say rpm -U xxx.new.rpm
rpm will first run the "%post" script of the new rpm before the
"%preun" script of the old rpm. This seems to be nonsense to me.
It should first do
rpm -e xxx.old.rpm
rpm -i xxx.new.rpm
This has been the behavior of rpm for A Long Time Now. See the complete
order of scriptlet execution in /usr/doc/rpm-*/triggers.