Hello community,

here is the log from the commit of package gtk2 for openSUSE:Factory checked in 
at 2017-07-17 08:59:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/gtk2 (Old)
 and      /work/SRC/openSUSE:Factory/.gtk2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "gtk2"

Mon Jul 17 08:59:43 2017 rev:159 rq:510088 version:2.24.31

Changes:
--------
--- /work/SRC/openSUSE:Factory/gtk2/gtk2.changes        2016-09-17 
14:36:43.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.gtk2.new/gtk2.changes   2017-07-17 
08:59:44.380420774 +0200
@@ -1,0 +2,8 @@
+Wed Jun 14 08:01:41 UTC 2017 - o...@aepfle.de
+
+- Add gtk2-updateiconcache_sort.patch: have gtk-update-icon-cache
+  sort directory entries when creating caches. The build system
+  uses this to produce an embedded cache for the stock icons. With
+  this, we can have reproducible builds.
+
+-------------------------------------------------------------------

New:
----
  gtk2-updateiconcache_sort.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ gtk2.spec ++++++
--- /var/tmp/diff_new_pack.kswpSn/_old  2017-07-17 08:59:45.644242821 +0200
+++ /var/tmp/diff_new_pack.kswpSn/_new  2017-07-17 08:59:45.648242258 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package gtk2
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -35,6 +35,8 @@
 Source5:        macros.gtk2
 # PATCH-FIX-UPSTREAM gtk2-window-dragging.patch bgo#611313 -- Taken from 
Fedora, to support window dragging from menubars/toolbars
 Patch0:         gtk2-window-dragging.patch
+# PATCH-FEATURE-OPENSUSE gtk2-updateiconcache_sort.patch o...@opensuse.org -- 
Have gtp-update-icon-cache sort the file list before producing a cache
+Patch1:         gtk2-updateiconcache_sort.patch
 # PATCH-FIX-OPENSUSE gtk2-GTK_PATH64.patch sbra...@novell.com - 64-bit dual 
install. Use GTK_PATH64 environment variable instead of GTK_PATH
 Patch8:         gtk2-GTK_PATH64.patch
 # PATCH-FEATURE-UPSTREAM 
bugzilla-129753-gtk+-2.8.9-localize-font-style-name.diff bnc129753 bgo319484 
mfab...@novell.com - Translate the font styles in the GUI
@@ -324,6 +326,7 @@
 done
 gnome-patch-translation-prepare
 %patch0 -p1
+%patch1 -p1
 %if "%{_lib}" == "lib64"
 cp -a %{SOURCE2} .
 # WARNING: This patch does not patch not installed demos and tests.

++++++ gtk2-updateiconcache_sort.patch ++++++
--- a/gtk/updateiconcache.c
+++ b/gtk/updateiconcache.c
@@ -37,6 +37,7 @@
 #include <utime.h>
 #endif
 
+#include <dirent.h>
 #include <glib.h>
 #include <glib/gstdio.h>
 #undef GDK_PIXBUF_DISABLE_DEPRECATED
@@ -594,6 +595,50 @@ replace_backslashes_with_slashes (gchar
       path[i] = '/';
 }
 
+struct sortdir {
+  struct dirent **nl;
+  int cur;
+  int max;
+};
+
+static const gchar *sort_item(struct sortdir *sd)
+{
+  while (sd->cur >= 0) {
+    if (strcmp (sd->nl[sd->cur]->d_name, "..") == 0)
+    {
+      sd->cur--;
+      continue;
+    }
+    if (strcmp (sd->nl[sd->cur]->d_name, ".") == 0)
+    {
+      sd->cur--;
+      continue;
+    }
+    return sd->nl[sd->cur--]->d_name;
+  }
+  return NULL;
+}
+
+static gboolean sort_open(char *path, struct sortdir *sd)
+{
+  int n;
+
+  n = scandir(path, &sd->nl, NULL, alphasort);
+  if (n <= 0)
+    return FALSE;
+  sd->max = sd->cur = n - 1;
+  return TRUE;
+}
+
+static void sort_close(struct sortdir *sd)
+{
+  int i;
+
+  for (i = sd->max; i >= 0; i--)
+    free(sd->nl[i]);
+  free(sd->nl);
+}
+
 static GList *
 scan_directory (const gchar *base_path, 
                const gchar *subdir, 
@@ -602,7 +647,7 @@ scan_directory (const gchar *base_path,
                gint         depth)
 {
   GHashTable *dir_hash;
-  GDir *dir;
+  struct sortdir sortdir;
   const gchar *name;
   gchar *dir_path;
   gboolean dir_added = FALSE;
@@ -610,15 +655,12 @@ scan_directory (const gchar *base_path,
   
   dir_path = g_build_path ("/", base_path, subdir, NULL);
 
-  /* FIXME: Use the gerror */
-  dir = g_dir_open (dir_path, 0, NULL);
-  
-  if (!dir)
+  if (sort_open(dir_path, &sortdir) == FALSE)
     return directories;
   
   dir_hash = g_hash_table_new (g_str_hash, g_str_equal);
 
-  while ((name = g_dir_read_name (dir)))
+  while ((name = sort_item(&sortdir)))
     {
       gchar *path;
       gboolean retval;
@@ -698,7 +740,7 @@ scan_directory (const gchar *base_path,
       g_free (path);
     }
 
-  g_dir_close (dir);
+  sort_close(&sortdir);
 
   /* Move dir into the big file hash */
   g_hash_table_foreach_remove (dir_hash, foreach_remove_func, files);

Reply via email to