]> code.ossystems Code Review - openembedded-core.git/commitdiff
manpages.bbclass: Fix rootfs host corruption
authorAlex Kiernan <alex.kiernan@gmail.com>
Thu, 9 Jan 2020 14:45:59 +0000 (14:45 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 27 Jan 2020 16:38:54 +0000 (16:38 +0000)
When running mandb we end up with files owned by the build user, correct
this. Also pick up non-default locales and relocate their index.db files
to /var/cache.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/manpages.bbclass

index 50c254763e8934bec448dde91bffd48942e39a17..1e66780646ea76e1873e1f7e8162760835ea6cf8 100644 (file)
@@ -18,8 +18,15 @@ pkg_postinst_append_${MAN_PKG} () {
                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
-                               mv $D${mandir}/index.db $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