If I put a dodir in a ebuild to create a directory and this directory remains empty between two emerges of the same package, the second emerge deletes de directory in the unmerging fase after the emerging one.
Created attachment 702 [details] My audiogalaxy ebuild that suffers from directory deletion I attach an ebuild that gets his /opt/audiogalaxy/shares deleted after two consecutive emerges of the ebuild.
Known issue to be fixed at a future date; for now, create any important empty dirs in pkg_postinst()