Gentoo Development Guide

pkg_postinst

Function pkg_postinst
Purpose Called after image is installed to ${ROOT}
Sandbox Disabled
Privilege root
Called for ebuild, binary

Default pkg_postinst

pkg_postinst()
{
    return
}

Sample pkg_postinst

pkg_postinst() {
    if $OLD_FLUXBOX_VERSION ; then
        ewarn "You must restart fluxbox before using the [include] /directory/"
        ewarn "feature if you are upgrading from an older fluxbox!"
        ewarn " "
    fi
    elog "If you experience font problems, or if fluxbox takes a very"
    elog "long time to start up, please try the 'disablexmb' USE flag."
    elog "If that fails, please report bugs upstream."
}

Common pkg_postinst Tasks

The most common use for pkg_postinst is to display post-install informational messages or warnings. If you want to display selective upgrade messages, you should do the call to has_version in an earlier phase, like pkg_preinst, and store the result in a global variable.