(test) nox-pc /etc/portage # cat bashrc set -x if [ "${EBUILD_PHASE}" == "postinst" ]; then echo "First, I install." fi if [ "${EBUILD_PHASE}" == "postrm" ] ; then echo "Second, I remove." echo "If I do some DB operations here and now with external DB" echo "The package even though it will not remove itself" echo "My DB will see this package as removed." fi set +x