poky/meta/classes/manpages.bbclass
Richard Purdie f4edd2c98b manpages: Fix override/append ordering and hence task signatures
The append/override ordering was meaning that whilst the data was being picked
up later in the package processing, it wasn't being picked up by do_package.
This means changes to qemu options were not causing task signatures to change.
Fix the variable ordering with the append to correct this.

The whitespace fix is deliberate to cause output to change and hopefully avoid
hash invalidation issues from unchanged output.

(From OE-Core rev: 407793a0fd4e562b626ff07024c5bbdc2a65b20e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2021-12-20 15:29:01 +00:00

46 lines
1.7 KiB
Plaintext

# Inherit this class to enable or disable building and installation of manpages
# depending on whether 'api-documentation' is in DISTRO_FEATURES. Such building
# tends to pull in the entire XML stack and other tools, so it's not enabled
# by default.
PACKAGECONFIG:append:class-target = " ${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', 'manpages', '', d)}"
inherit qemu
# usually manual files are packaged to ${PN}-doc except man-pages
MAN_PKG ?= "${PN}-doc"
# only add man-db to RDEPENDS when manual files are built and installed
RDEPENDS:${MAN_PKG} += "${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'man-db', '', d)}"
pkg_postinst:${MAN_PKG}:append () {
# only update manual page index caches when manual files are built and installed
if ${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'true', 'false', d)}; then
if test -n "$D"; then
if ${@bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'true', 'false', d)}; then
sed "s:\(\s\)/:\1$D/:g" $D${sysconfdir}/man_db.conf | ${@qemu_run_binary(d, '$D', '${bindir}/mandb')} -C - -u -q $D${mandir}
chown -R root:root $D${mandir}
mkdir -p $D${localstatedir}/cache/man
cd $D${mandir}
find . -name index.db | while read index; do
mkdir -p $D${localstatedir}/cache/man/$(dirname ${index})
mv ${index} $D${localstatedir}/cache/man/${index}
chown man:man $D${localstatedir}/cache/man/${index}
done
cd -
else
$INTERCEPT_DIR/postinst_intercept delay_to_first_boot ${PKG} mlprefix=${MLPREFIX}
fi
else
mandb -q
fi
fi
}
pkg_postrm:${MAN_PKG}:append () {
# only update manual page index caches when manual files are built and installed
if ${@bb.utils.contains('PACKAGECONFIG', 'manpages', 'true', 'false', d)}; then
mandb -q
fi
}