From 0a7a56e0e5954a3414e0a7763581949edcc20c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?coadde=20=5BM=C3=A1rcio=20Alexandre=20Silva=20Delgado=5D?= Date: Wed, 13 Apr 2016 15:35:21 -0300 Subject: glib2-static: add new package to [libre] --- ...Don-t-crash-when-no-schemas-are-installed.patch | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 libre/glib2-static/0001-gsettings-Don-t-crash-when-no-schemas-are-installed.patch (limited to 'libre/glib2-static/0001-gsettings-Don-t-crash-when-no-schemas-are-installed.patch') diff --git a/libre/glib2-static/0001-gsettings-Don-t-crash-when-no-schemas-are-installed.patch b/libre/glib2-static/0001-gsettings-Don-t-crash-when-no-schemas-are-installed.patch new file mode 100644 index 000000000..44a56101d --- /dev/null +++ b/libre/glib2-static/0001-gsettings-Don-t-crash-when-no-schemas-are-installed.patch @@ -0,0 +1,49 @@ +From 4850cb55d3415b7d95c80c80ceb60f221f5dddf5 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Wed, 24 Feb 2016 18:58:25 +0100 +Subject: [PATCH] gsettings: Don't crash when no schemas are installed + +Still doesn't behave well ("gsettings help" causes an error), +but at least there's no segfault anymore. +--- + gio/gsettings-tool.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/gio/gsettings-tool.c b/gio/gsettings-tool.c +index 6a302ce..0026f55 100644 +--- a/gio/gsettings-tool.c ++++ b/gio/gsettings-tool.c +@@ -697,7 +697,7 @@ main (int argc, char **argv) + if (argc < 2) + return gsettings_help (FALSE, NULL); + +- global_schema_source = g_settings_schema_source_ref (g_settings_schema_source_get_default ()); ++ global_schema_source = g_settings_schema_source_get_default (); + + if (argc > 3 && g_str_equal (argv[1], "--schemadir")) + { +@@ -705,7 +705,6 @@ main (int argc, char **argv) + GError *error = NULL; + + global_schema_source = g_settings_schema_source_new_from_directory (argv[2], parent, FALSE, &error); +- g_settings_schema_source_unref (parent); + + if (global_schema_source == NULL) + { +@@ -719,6 +718,13 @@ main (int argc, char **argv) + argv = argv + 2; + argc -= 2; + } ++ else if (global_schema_source == NULL) ++ { ++ g_printerr (_("No schemas installed\n")); ++ return 1; ++ } ++ else ++ g_settings_schema_source_ref (global_schema_source); + + need_settings = TRUE; + +-- +2.7.1 + -- cgit v1.2.3-2-g168b