Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From 1049fbd887e52f94afeb03fc7942c01c143ebdfc Mon Sep 17 00:00:00 2001 |
| 2 | From: Jussi Kukkonen <jussi.kukkonen@intel.com> |
| 3 | Date: Fri, 9 Jun 2017 12:01:25 +0300 |
| 4 | Subject: [PATCH] queryloaders: Make output more reproducible |
| 5 | |
| 6 | Reproducible builds are good: Sort the output by module name so that |
| 7 | same input always leads to same output. |
| 8 | |
| 9 | This should also make gdk-pixbuf-print-mime-types output and |
| 10 | gdk-pixbuf-thumbnailer.thumbnailer reproducible. |
| 11 | |
| 12 | https://bugzilla.gnome.org/show_bug.cgi?id=783592 |
| 13 | |
| 14 | Upstream-Status: Submitted |
| 15 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> |
| 16 | --- |
| 17 | gdk-pixbuf/queryloaders.c | 12 ++++++++++-- |
| 18 | 1 file changed, 10 insertions(+), 2 deletions(-) |
| 19 | |
| 20 | diff --git a/gdk-pixbuf/queryloaders.c b/gdk-pixbuf/queryloaders.c |
| 21 | index 395674a..4ac9b28 100644 |
| 22 | --- a/gdk-pixbuf/queryloaders.c |
| 23 | +++ b/gdk-pixbuf/queryloaders.c |
| 24 | @@ -346,6 +346,7 @@ int main (int argc, char **argv) |
| 25 | #ifdef USE_GMODULE |
| 26 | const char *path; |
| 27 | GDir *dir; |
| 28 | + GList *l, *modules = NULL; |
| 29 | |
| 30 | path = g_getenv ("GDK_PIXBUF_MODULEDIR"); |
| 31 | #ifdef G_OS_WIN32 |
| 32 | @@ -365,12 +366,19 @@ int main (int argc, char **argv) |
| 33 | gint len = strlen (dent); |
| 34 | if (len > SOEXT_LEN && |
| 35 | strcmp (dent + len - SOEXT_LEN, SOEXT) == 0) { |
| 36 | + modules = g_list_prepend (modules, |
| 37 | + g_strdup (dent)); |
| 38 | - if (!query_module (contents, path, dent)) |
| 39 | - success = FALSE; |
| 40 | } |
| 41 | } |
| 42 | g_dir_close (dir); |
| 43 | } |
| 44 | + |
| 45 | + modules = g_list_sort (modules, (GCompareFunc)strcmp); |
| 46 | + for (l = modules; l != NULL; l = l->next) |
| 47 | + if (!query_module (contents, path, l->data)) |
| 48 | + success = FALSE; |
| 49 | + |
| 50 | + g_list_free_full (modules, g_free); |
| 51 | #else |
| 52 | g_string_append_printf (contents, "# dynamic loading of modules not supported\n"); |
| 53 | #endif |
| 54 | -- |
| 55 | 2.1.4 |
| 56 | |