diff options
Diffstat (limited to 'scripts/postinst-intercepts')
-rw-r--r-- | scripts/postinst-intercepts/update_desktop_database | 8 | ||||
-rw-r--r-- | scripts/postinst-intercepts/update_font_cache | 4 | ||||
-rw-r--r-- | scripts/postinst-intercepts/update_gtk_icon_cache | 6 | ||||
-rw-r--r-- | scripts/postinst-intercepts/update_mandb | 18 | ||||
-rw-r--r-- | scripts/postinst-intercepts/update_mime_database | 9 | ||||
-rw-r--r-- | scripts/postinst-intercepts/update_udev_hwdb | 20 |
6 files changed, 62 insertions, 3 deletions
diff --git a/scripts/postinst-intercepts/update_desktop_database b/scripts/postinst-intercepts/update_desktop_database new file mode 100644 index 0000000000..8903b496f3 --- /dev/null +++ b/scripts/postinst-intercepts/update_desktop_database @@ -0,0 +1,8 @@ +#!/bin/sh +# +# SPDX-License-Identifier: MIT +# +# Post-install intercept for mime-xdg.bbclass + +update-desktop-database $D${desktop_dir} + diff --git a/scripts/postinst-intercepts/update_font_cache b/scripts/postinst-intercepts/update_font_cache index 3053c7065f..900db042d6 100644 --- a/scripts/postinst-intercepts/update_font_cache +++ b/scripts/postinst-intercepts/update_font_cache @@ -5,5 +5,9 @@ set -e +rm -f $D${fontconfigcachedir}/CACHEDIR.TAG + PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D -E ${fontconfigcacheenv} $D${libexecdir}/${binprefix}fc-cache --sysroot=$D --system-only ${fontconfigcacheparams} + chown -R root:root $D${fontconfigcachedir} +find $D -type f -name .uuid -exec chown root:root '{}' + diff --git a/scripts/postinst-intercepts/update_gtk_icon_cache b/scripts/postinst-intercepts/update_gtk_icon_cache index 99367a2855..a92bd840c6 100644 --- a/scripts/postinst-intercepts/update_gtk_icon_cache +++ b/scripts/postinst-intercepts/update_gtk_icon_cache @@ -11,7 +11,11 @@ $STAGING_DIR_NATIVE/${libdir_native}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders --u for icondir in $D/usr/share/icons/*/ ; do if [ -d $icondir ] ; then - gtk-update-icon-cache -fqt $icondir + for gtkuic_cmd in gtk-update-icon-cache gtk4-update-icon-cache ; do + if [ -n "$(which $gtkuic_cmd)" ]; then + $gtkuic_cmd -fqt $icondir + fi + done fi done diff --git a/scripts/postinst-intercepts/update_mandb b/scripts/postinst-intercepts/update_mandb new file mode 100644 index 0000000000..f91bafdb11 --- /dev/null +++ b/scripts/postinst-intercepts/update_mandb @@ -0,0 +1,18 @@ +#!/bin/sh +# +# SPDX-License-Identifier: MIT +# + +set -eu + +# Create a temporary man_db.conf with paths to the rootfs, as mandb needs absolute paths +CONFIG=$(mktemp --tmpdir update-mandb.XXXXX) +sed "s:\(\s\)/:\1$D/:g" $D${sysconfdir}/man_db.conf > $CONFIG + +mkdir -p $D${localstatedir}/cache/man/ + +PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${bindir}/mandb --config-file $CONFIG --create + +rm -f $CONFIG + +chown -R man:man $D${localstatedir}/cache/man/ diff --git a/scripts/postinst-intercepts/update_mime_database b/scripts/postinst-intercepts/update_mime_database new file mode 100644 index 0000000000..582d1e162c --- /dev/null +++ b/scripts/postinst-intercepts/update_mime_database @@ -0,0 +1,9 @@ +#!/bin/sh +# +# SPDX-License-Identifier: MIT +# +# Post-install intercept for mime.bbclass + +echo "Updating MIME database... this may take a while." +update-mime-database $D${mimedir} + diff --git a/scripts/postinst-intercepts/update_udev_hwdb b/scripts/postinst-intercepts/update_udev_hwdb index c4fb2bffcb..8b3f5de791 100644 --- a/scripts/postinst-intercepts/update_udev_hwdb +++ b/scripts/postinst-intercepts/update_udev_hwdb @@ -5,5 +5,21 @@ set -e -PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${libexecdir}/${binprefix}udevadm hwdb --update --root $D -chown root:root $D${sysconfdir}/udev/hwdb.bin +case "${PREFERRED_PROVIDER_udev}" in + systemd) + UDEV_EXTRA_ARGS="--usr" + UDEVLIBDIR="${rootlibexecdir}" + UDEVADM="${base_bindir}/udevadm" + ;; + + *) + UDEV_EXTRA_ARGS="" + UDEVLIBDIR="${sysconfdir}" + UDEVADM="${bindir}/udevadm" + ;; +esac + +rm -f $D${UDEVLIBDIR}/udev/hwdb.bin +PSEUDO_UNLOAD=1 ${binprefix}qemuwrapper -L $D $D${UDEVADM} hwdb --update --root $D ${UDEV_EXTRA_ARGS} || + PSEUDO_UNLOAD=1 qemuwrapper -L $D $D${UDEVADM} hwdb --update --root $D ${UDEV_EXTRA_ARGS} +chown root:root $D${UDEVLIBDIR}/udev/hwdb.bin |