Skip to contentSkip to conversation

why two pkg_postinst-${PN} routines in quagga.inc?

DISCUSSION Robert P. J. Day 1 participant 1 message Apr 7, 2020

lore
Share & tools
lore
#0 lore raw

wanted to expand on the explanation of post-install scripts using
examples out of OE/YP layers, and ran across this oddity in meta-openembedded/meta-networking, in quagga.inc.

here's what's at line 146:

pkg_postinst_${PN} () {
    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd sysvinit', 'true', 'false', d)}; then
        if [ -n "$D" ]; then
            OPTS="--root=$D"
        fi
        systemctl $OPTS mask quagga.service
    fi
}

but here's what's further down at line 204:

pkg_postinst_${PN} () {
    if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then
        ${sysconfdir}/init.d/populate-volatile.sh update
    fi
}

where the second definition appears to override the first one. is there some magic regarding defining two pkg_postinst() routines for the same package? or is that just an oversight?

rday