From ca9b7ce74a00bef3f141074b5720b9da6a99cc27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeremy=20B=C3=ADcha?= Date: Mon, 27 Jan 2025 11:45:12 -0500 Subject: [PATCH] Revert "Remove obsolete gtk-update-icon-cache package, now built by gtk4" This reverts commit ac309bfb0cd4af5964cf89a43e3c75eefd59fd3d. --- debian/control | 18 ++++++++++ debian/gtk-update-icon-cache.install | 2 ++ ...stalled => gtk-update-icon-cache.manpages} | 1 - debian/patches/060_ignore-random-icons.patch | 34 +++++++++++++++++++ debian/patches/series | 1 + debian/update-icon-caches | 26 ++++++++++++++ debian/update-icon-caches.8 | 19 +++++++++++ 7 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 debian/gtk-update-icon-cache.install rename debian/{not-installed => gtk-update-icon-cache.manpages} (58%) create mode 100644 debian/patches/060_ignore-random-icons.patch create mode 100644 debian/update-icon-caches create mode 100644 debian/update-icon-caches.8 diff --git a/debian/control b/debian/control index 6f096863e9..565573b692 100644 --- a/debian/control +++ b/debian/control @@ -255,6 +255,24 @@ Description: GTK graphical user interface library -- gir bindings This package can be used by other packages using the GIRepository format to generate dynamic bindings. +Package: gtk-update-icon-cache +Section: misc +Architecture: any +Multi-Arch: foreign +Depends: ${misc:Depends}, + ${shlibs:Depends} +Breaks: libgtk-3-bin (<< 3.20.6-1), + libgtk2.0-bin (<< 2.24.30-2) +Replaces: libgtk-3-bin (<< 3.20.6-1), + libgtk2.0-bin (<< 2.24.30-2) +Description: icon theme caching utility + gtk-update-icon-cache creates mmap()able cache files for icon themes. + . + GTK can use the cache files created by gtk-update-icon-cache to avoid a lot + of system call and disk seek overhead when the application starts. Since the + format of the cache files allows them to be mmap()ed shared between multiple + applications, the overall memory consumption is reduced as well. + Package: libgail-3-0t64 Provides: ${t64:Provides} Replaces: libgail-3-0 (<< 3.24.41-1.1) diff --git a/debian/gtk-update-icon-cache.install b/debian/gtk-update-icon-cache.install new file mode 100644 index 0000000000..0da3f89248 --- /dev/null +++ b/debian/gtk-update-icon-cache.install @@ -0,0 +1,2 @@ +../../../debian/update-icon-caches usr/sbin/ +usr/bin/gtk-update-icon-cache diff --git a/debian/not-installed b/debian/gtk-update-icon-cache.manpages similarity index 58% rename from debian/not-installed rename to debian/gtk-update-icon-cache.manpages index 0bc96c5f66..1b2f405f4b 100644 --- a/debian/not-installed +++ b/debian/gtk-update-icon-cache.manpages @@ -1,2 +1 @@ -usr/bin/gtk-update-icon-cache usr/share/man/man1/gtk-update-icon-cache.1 diff --git a/debian/patches/060_ignore-random-icons.patch b/debian/patches/060_ignore-random-icons.patch new file mode 100644 index 0000000000..f9448a640e --- /dev/null +++ b/debian/patches/060_ignore-random-icons.patch @@ -0,0 +1,34 @@ +From: Loic Minier +Date: Sun, 21 Oct 2007 22:05:42 +0200 +Subject: Don't list images from unknown directories in icon cache + +After GTK 2.12.0, gtk-update-icon-cache fails if there is a PNG file +placed directly in /usr/share/icons/hicolor (not in a correct +subdirectory like 48x48/apps). + +TODO: This is believed to have been fixed differently upstream, so maybe +this change is no longer necessary: +"I believe a slightly different fix that I did some time ago fixes this +too." --Matthias Clasen, 2008-02-16 04:43:10 UTC + +Bug: https://bugzilla.gnome.org/show_bug.cgi?id=451634 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=444285 +Forwarded: yes +Applied-upstream: no +--- + gtk/updateiconcache.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gtk/updateiconcache.c b/gtk/updateiconcache.c +index 37f9b4f..52853dd 100644 +--- a/gtk/updateiconcache.c ++++ b/gtk/updateiconcache.c +@@ -689,7 +689,7 @@ scan_directory (const gchar *base_path, + directories = g_list_append (directories, g_strdup (subdir)); + } + else +- dir_index = 0xffff; ++ continue; + } + + image = g_new0 (Image, 1); diff --git a/debian/patches/series b/debian/patches/series index 9bbb8b08f3..75e2a23964 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,5 @@ 016_no_offscreen_widgets_grabbing.patch 017_no_offscreen_device_grabbing.patch +060_ignore-random-icons.patch reftest_compare_surfaces-Report-how-much-the-images-diffe.patch reftests-Allow-minor-differences-to-be-tolerated.patch diff --git a/debian/update-icon-caches b/debian/update-icon-caches new file mode 100644 index 0000000000..2accbe0adc --- /dev/null +++ b/debian/update-icon-caches @@ -0,0 +1,26 @@ +#!/bin/sh + +case "$1" in + ""|-h|--help) + echo "Usage: $0 directory [ ... ]" + exit 1 + ;; +esac + +for dir in "$@"; do + if [ ! -d "$dir" ]; then + continue + fi + if [ -f "$dir"/index.theme ]; then + # Generate or regenerate the cache + if ! gtk-update-icon-cache --force --quiet "$dir"; then + echo "WARNING: icon cache generation failed for $dir" + fi + else + # No more index.theme, remove the cache if it exists + rm -f "$dir"/icon-theme.cache + rmdir -p --ignore-fail-on-non-empty "$dir" + fi +done + +exit 0 diff --git a/debian/update-icon-caches.8 b/debian/update-icon-caches.8 new file mode 100644 index 0000000000..03105e7c6a --- /dev/null +++ b/debian/update-icon-caches.8 @@ -0,0 +1,19 @@ +.TH UPDATE-ICON-CACHES 8 "13 July 2007" +.SH NAME +update-icon-caches \- Update wrapper script for the icon caches +.SH SYNOPSIS +\fBupdate-icon-caches\fP \fIdirectory\fP [ \fI...\fP ] +.SH DESCRIPTION +\fBupdate-icon-caches\fP is a wrapper script for updating the icon +caches in a list of directories. +.P +In each of the directories passed as arguments, the icon cache is +updated if it is already present. It is not created if it does not +already exist. +.P +If the theme index file is not present, the icon cache is removed. +.SH SEE ALSO +.BR gtk-update-icon-cache (1) +.SH AUTHOR +This manual page was written by Josselin Mouette , +for the Debian GNU/Linux system.