Skip to contentSkip to conversation

manpages.bbclass: Fix rootfs host corruption

PATCH RESEND New Alex Kiernan 1 participant 1 message Jan 9, 2020

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 manpages.bbclass: Fix rootfs host corruption

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.

---

 meta/classes/manpages.bbclass | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
meta/classes/manpages.bbclass +8 -1
index 50c254763e89..1e66780646ea 100644
@@ -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
Signature · 1 line
2.17.1