summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lamb <lamby@debian.org>2017-08-20 08:03:21 -0700
committerHans Petter Jansson <hpj@cl.no>2019-07-23 18:51:19 +0200
commit448ebe8825a9f9be6f3278fc1ca415cd26dd96d9 (patch)
treebd1cf55082eb36fc0082a80a2106042396743b05
parent7cebcedd9cf392977d40910a660245dc3f73b257 (diff)
downloaddesktop-file-utils-448ebe8825a9f9be6f3278fc1ca415cd26dd96d9.tar.gz
update-desktop-database.c: Sort output within lines, not the just between them.
Whilst working on the Reproducible Builds effort [0], we noticed that desktop-file-utils produces mimeinfo.cache files that are not reproducible. This is because it inherits the non-deterministic hash ordering of the mime_types_map data structure. Patch attached that sorts just prior to output. [0] https://reproducible-builds.org/ Signed-off-by: Hans Petter Jansson <hpj@cl.no>
-rw-r--r--src/update-desktop-database.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/update-desktop-database.c b/src/update-desktop-database.c
index ce4d8c8..b1bca9c 100644
--- a/src/update-desktop-database.c
+++ b/src/update-desktop-database.c
@@ -307,6 +307,7 @@ add_mime_type (const char *mime_type, GList *desktop_files, FILE *f)
list = g_string_new (mime_type);
g_string_append_c (list, '=');
+ desktop_files = g_list_sort (desktop_files, (GCompareFunc) g_strcmp0);
for (desktop_file = desktop_files;
desktop_file != NULL;
desktop_file = desktop_file->next)