(test) nox-pc /etc/portage # emerge hello Local copy of remote index is up-to-date and will be used. Calculating dependencies ... done! >>> Emerging binary (1 of 1) app-misc/hello-2.10::gentoo * hello-2.10.tbz2 MD5 SHA1 size ;-) ... [ ok ] ++ '[' clean == postinst ']' ++ '[' clean == postrm ']' ++ set +x >>> Extracting info ++ '[' setup == postinst ']' ++ '[' setup == postrm ']' ++ set +x >>> Extracting app-misc/hello-2.10 >>> Installing (1 of 1) app-misc/hello-2.10::gentoo ++ '[' '' == postinst ']' ++ '[' '' == postrm ']' ++ set +x * Removing /usr/lib/debug ++ '[' preinst == postinst ']' ++ '[' preinst == postrm ']' ++ set +x ++ '[' '' == postinst ']' ++ '[' '' == postrm ']' ++ set +x ++ '[' prerm == postinst ']' ++ '[' prerm == postrm ']' ++ set +x ++ '[' postrm == postinst ']' ++ '[' postrm == postrm ']' ++ echo 'Second, I remove.' Second, I remove. ++ echo 'If I do some DB operations here and now with external DB' If I do some DB operations here and now with external DB ++ echo 'The package even though it will not remove itself' The package even though it will not remove itself ++ echo 'My DB will see this package as removed.' My DB will see this package as removed. ++ set +x ++ '[' cleanrm == postinst ']' ++ '[' cleanrm == postrm ']' ++ set +x ++ '[' postinst == postinst ']' ++ echo 'First, I install.' First, I install. ++ '[' postinst == postrm ']' ++ set +x ++ '[' '' == postinst ']' ++ '[' '' == postrm ']' ++ set +x ++ '[' '' == postinst ']' ++ '[' '' == postrm ']' ++ set +x ++ '[' clean == postinst ']' ++ '[' clean == postrm ']' ++ set +x >>> Auto-cleaning packages... >>> No outdated packages were found on your system. * Regenerating GNU info directory index... * Processed 130 info files. (test) nox-pc /etc/portage #