Skip to contentSkip to conversation

update_gtk_icon_cache: Fix for GTK4-only builds

PATCH New Zoltán Böszörményi 1 participant 1 message Dec 6, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 update_gtk_icon_cache: Fix for GTK4-only builds

Try to execute both gtk-update-icon-cache and
gtk4-update-icon-cache after checking whether the
commands are available.

This attempts to match what gtk-icon-cache.bbclass is doing.

This fixes running update_gtk_icon_cache during do_rootfs for an image that contains only GTK4 related packages.

---
 scripts/postinst-intercepts/update_gtk_icon_cache | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
scripts/postinst-intercepts/update_gtk_icon_cache +5 -1
index 99367a2855..a92bd840c6 100644
@@ -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
 
Signature · 1 line
2.43.0