Skip to content

Instantly share code, notes, and snippets.

@pwithnall
Last active February 21, 2019 14:41
Show Gist options
  • Save pwithnall/2e7b40c39333f4874a14b8901aec0ae1 to your computer and use it in GitHub Desktop.
Save pwithnall/2e7b40c39333f4874a14b8901aec0ae1 to your computer and use it in GitHub Desktop.
git diff new-master..upstream/2.59.2 !(debian)
diff --git a/docs/reference/glib/running.xml b/docs/reference/glib/running.xml
index ec33ea625..8e4ffeca3 100644
--- a/docs/reference/glib/running.xml
+++ b/docs/reference/glib/running.xml
@@ -256,24 +256,6 @@ How to run and debug your GLib application
</para>
</formalpara>
-<formalpara id="G_HOME">
- <title><envar>G_HOME</envar></title>
-
- <para>
- Historically, GLib applications ignored the <envar>HOME</envar>
- environment variable on Unix systems, instead using the user directory
- as specified by the <filename>passwd</filename> entry. As of GLib 2.35.3,
- this is no longer true: <envar>HOME</envar> is respected.
- </para>
- <para>
- The <envar>G_HOME</envar> environment variable will override any
- other setting for the home directory. It is not meant for daily usage, but
- it is useful in testing or building environments. As <envar>HOME</envar> is
- now supported by GLib, <envar>G_HOME</envar> is deprecated and will be
- removed in a future release.
- </para>
-</formalpara>
-
</refsect2>
<refsect2 id="setlocale">
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index 36f3cfb64..7d7425ea9 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -2741,9 +2741,9 @@ g_desktop_app_info_launch_uris_with_spawn (GDesktopAppInfo *info,
/* Allow test suite to specify path to gio-launch-desktop */
tmp = g_getenv ("GIO_LAUNCH_DESKTOP");
+ /* Fall back on usual searching in $PATH */
if (tmp == NULL)
- tmp = GIO_LIBDIR "/glib-2.0/gio-launch-desktop";
-
+ tmp = "gio-launch-desktop";
g_once_init_leave (&gio_launch_desktop_path, tmp);
}
diff --git a/gio/giomodule.c b/gio/giomodule.c
index cdb20ca32..b92162dcc 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -1206,9 +1206,6 @@ _g_io_modules_ensure_loaded (void)
g_io_module_scope_free (scope);
- /* Hard-coded fallback directory for pre-multiarch compatibility */
- g_io_modules_scan_all_in_directory ("/usr/lib/gio/modules");
-
/* Initialize types from built-in "modules" */
g_type_ensure (g_null_settings_backend_get_type ());
g_type_ensure (g_memory_settings_backend_get_type ());
diff --git a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c
index 7bd8cfb0a..5e1bebbba 100644
--- a/gio/glib-compile-schemas.c
+++ b/gio/glib-compile-schemas.c
@@ -1233,9 +1233,6 @@ parse_state_start_schema (ParseState *state,
return;
}
- // Disable this warning: it confuses users and there is unlikely to be much
- // progress towards fixing
- /*
if (path && (g_str_has_prefix (path, "/apps/") ||
g_str_has_prefix (path, "/desktop/") ||
g_str_has_prefix (path, "/system/")))
@@ -1248,7 +1245,6 @@ parse_state_start_schema (ParseState *state,
g_printerr ("%s\n", message);
g_free (message);
}
- */
state->schema_state = schema_state_new (path, gettext_domain,
extends, extends_name, list_of);
diff --git a/gio/gvdb/gvdb-reader.c b/gio/gvdb/gvdb-reader.c
index 95093885f..aa3154feb 100644
--- a/gio/gvdb/gvdb-reader.c
+++ b/gio/gvdb/gvdb-reader.c
@@ -332,7 +332,7 @@ gvdb_table_list_from_item (GvdbTable *table,
/**
* gvdb_table_get_names:
* @table: a #GvdbTable
- * @length: (optional): the number of items returned, or %NULL
+ * @length: the number of items returned, or %NULL
*
* Gets a list of all names contained in @table.
*
@@ -344,11 +344,11 @@ gvdb_table_list_from_item (GvdbTable *table,
* above calls in the case of the corrupted file. Note also that the
* returned strings may not be utf8.
*
- * Returns: (array length=length): a %NULL-terminated list of strings, of length @length
+ * Returns: a %NULL-terminated list of strings, of length @length
**/
gchar **
gvdb_table_get_names (GvdbTable *table,
- gsize *length)
+ gint *length)
{
gchar **names;
gint n_names;
@@ -462,7 +462,7 @@ gvdb_table_get_names (GvdbTable *table,
{
GPtrArray *fixed_names;
- fixed_names = g_ptr_array_sized_new (n_names);
+ fixed_names = g_ptr_array_new ();
for (i = 0; i < n_names; i++)
if (names[i] != NULL)
g_ptr_array_add (fixed_names, names[i]);
@@ -474,10 +474,7 @@ gvdb_table_get_names (GvdbTable *table,
}
if (length)
- {
- G_STATIC_ASSERT (sizeof (*length) >= sizeof (n_names));
- *length = n_names;
- }
+ *length = n_names;
return names;
}
diff --git a/gio/gvdb/gvdb-reader.h b/gio/gvdb/gvdb-reader.h
index 9bf627f4b..39827737d 100644
--- a/gio/gvdb/gvdb-reader.h
+++ b/gio/gvdb/gvdb-reader.h
@@ -38,7 +38,7 @@ G_GNUC_INTERNAL
void gvdb_table_free (GvdbTable *table);
G_GNUC_INTERNAL
gchar ** gvdb_table_get_names (GvdbTable *table,
- gsize *length);
+ gint *length);
G_GNUC_INTERNAL
gchar ** gvdb_table_list (GvdbTable *table,
const gchar *key);
diff --git a/gio/meson.build b/gio/meson.build
index 84c5af11b..d7f4f3f31 100644
--- a/gio/meson.build
+++ b/gio/meson.build
@@ -1,7 +1,6 @@
gio_c_args = [
'-DG_LOG_DOMAIN="GLib-GIO"',
'-DGIO_COMPILATION',
- '-DGIO_LIBDIR="@0@"'.format(glib_libdir),
'-DGIO_MODULE_DIR="@0@"'.format(glib_giomodulesdir),
]
@@ -829,7 +828,7 @@ pkg.generate(libgio,
'schemasdir=' + join_paths('${datadir}', schemas_subdir),
'bindir=' + join_paths('${prefix}', get_option('bindir')),
'giomoduledir=' + giomodulesdir,
- 'glib_compile_schemas=' + join_paths('${libdir}', 'glib-2.0', 'glib-compile-schemas'),
+ 'glib_compile_schemas=' + join_paths('${bindir}', 'glib-compile-schemas'),
'glib_compile_resources=' + join_paths('${bindir}', 'glib-compile-resources'),
'gdbus_codegen=' + join_paths('${bindir}', 'gdbus-codegen')],
version : glib_version,
diff --git a/gio/tests/gdbus-threading.c b/gio/tests/gdbus-threading.c
index 165dbb7a2..3e4dc92e5 100644
--- a/gio/tests/gdbus-threading.c
+++ b/gio/tests/gdbus-threading.c
@@ -499,12 +499,6 @@ test_threaded_singleton (void)
guint unref_wins = 0;
guint get_wins = 0;
- if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL)
- {
- g_test_skip ("Not reliable (glib#1515)");
- return;
- }
-
if (g_test_thorough ())
n = 100000;
else
diff --git a/gio/tests/monitor.c b/gio/tests/monitor.c
index 01d91a09e..4d64fa826 100644
--- a/gio/tests/monitor.c
+++ b/gio/tests/monitor.c
@@ -214,9 +214,7 @@ main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
-#ifdef __linux__
g_test_add ("/monitor/directory", Fixture, NULL, setup, test_directory_monitor, teardown);
-#endif
return g_test_run ();
}
diff --git a/gio/tests/socket.c b/gio/tests/socket.c
index 5eba57a98..8410a3e84 100644
--- a/gio/tests/socket.c
+++ b/gio/tests/socket.c
@@ -1111,14 +1111,6 @@ test_timed_wait (void)
gint64 start_time;
gint poll_duration;
-#if defined(__arm__)
- if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL)
- {
- g_test_skip ("Not reliable on older ARM hardware");
- return;
- }
-#endif
-
data = create_server (G_SOCKET_FAMILY_IPV4, echo_server_thread, FALSE, &error);
if (error != NULL)
{
diff --git a/glib/gkeyfile.c b/glib/gkeyfile.c
index b3bc9872e..41883e968 100644
--- a/glib/gkeyfile.c
+++ b/glib/gkeyfile.c
@@ -511,7 +511,6 @@ struct _GKeyFile
GKeyFileFlags flags;
gchar **locales;
- gchar *gettext_domain;
volatile gint ref_count;
};
@@ -637,7 +636,6 @@ g_key_file_init (GKeyFile *key_file)
key_file->list_separator = ';';
key_file->flags = 0;
key_file->locales = g_strdupv ((gchar **)g_get_language_names ());
- key_file->gettext_domain = NULL;
}
static void
@@ -657,12 +655,6 @@ g_key_file_clear (GKeyFile *key_file)
key_file->parse_buffer = NULL;
}
- if (key_file->gettext_domain)
- {
- g_free (key_file->gettext_domain);
- key_file->gettext_domain = NULL;
- }
-
tmp = key_file->groups;
while (tmp != NULL)
{
@@ -882,21 +874,6 @@ g_key_file_load_from_fd (GKeyFile *key_file,
return FALSE;
}
- key_file->gettext_domain = g_key_file_get_string (key_file,
- G_KEY_FILE_DESKTOP_GROUP,
- G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN,
- NULL);
- if (!key_file->gettext_domain)
- key_file->gettext_domain = g_key_file_get_string (key_file,
- G_KEY_FILE_DESKTOP_GROUP,
- "X-Ubuntu-Gettext-Domain",
- NULL);
- if (!key_file->gettext_domain)
- key_file->gettext_domain = g_key_file_get_string (key_file,
- G_KEY_FILE_DESKTOP_GROUP,
- "X-Debian-Gettext-Domain",
- NULL);
-
return TRUE;
}
@@ -1009,21 +986,6 @@ g_key_file_load_from_data (GKeyFile *key_file,
return FALSE;
}
- key_file->gettext_domain = g_key_file_get_string (key_file,
- G_KEY_FILE_DESKTOP_GROUP,
- G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN,
- NULL);
- if (!key_file->gettext_domain)
- key_file->gettext_domain = g_key_file_get_string (key_file,
- G_KEY_FILE_DESKTOP_GROUP,
- "X-Ubuntu-Gettext-Domain",
- NULL);
- if (!key_file->gettext_domain)
- key_file->gettext_domain = g_key_file_get_string (key_file,
- G_KEY_FILE_DESKTOP_GROUP,
- "X-Debian-Gettext-Domain",
- NULL);
-
return TRUE;
}
@@ -2251,8 +2213,6 @@ g_key_file_get_locale_string (GKeyFile *key_file,
GError *key_file_error;
gchar **languages;
gboolean free_languages = FALSE;
- gboolean try_gettext = FALSE;
- const gchar *msg_locale;
gint i;
g_return_val_if_fail (key_file != NULL, NULL);
@@ -2274,25 +2234,6 @@ g_key_file_get_locale_string (GKeyFile *key_file,
free_languages = FALSE;
}
- /* we're only interested in gettext translation if we don't have a
- * translation in the .desktop file itself and if the key is one of the keys
- * we know we want to translate: Name, GenericName, Comment, Keywords.
- * Blindly doing this for all keys can give strange result for the icons,
- * since the Icon is a locale string in the spec, eg. We also only get
- * translation in the mo file if the requested locale is the LC_MESSAGES one.
- * Ideally, we should do more and change LC_MESSAGES to use the requested
- * locale, but there's no guarantee it's installed on the system and it might
- * have some side-effects. Since this is a corner case, let's ignore it. */
- msg_locale = setlocale (LC_MESSAGES, NULL);
- try_gettext = msg_locale && key_file->gettext_domain &&
- (strcmp (group_name, G_KEY_FILE_DESKTOP_GROUP) == 0 ||
- g_str_has_prefix (group_name, G_KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX)) &&
- (strcmp (key, G_KEY_FILE_DESKTOP_KEY_NAME) == 0 ||
- strcmp (key, G_KEY_FILE_DESKTOP_KEY_FULLNAME) == 0 ||
- strcmp (key, G_KEY_FILE_DESKTOP_KEY_GENERIC_NAME) == 0 ||
- strcmp (key, G_KEY_FILE_DESKTOP_KEY_KEYWORDS) == 0 ||
- strcmp (key, G_KEY_FILE_DESKTOP_KEY_COMMENT) == 0);
-
for (i = 0; languages[i]; i++)
{
candidate_key = g_strdup_printf ("%s[%s]", key, languages[i]);
@@ -2309,39 +2250,6 @@ g_key_file_get_locale_string (GKeyFile *key_file,
translated_value = NULL;
}
- /* Fallback to gettext */
- if (try_gettext && !translated_value)
- {
- gchar *orig_value = g_key_file_get_string (key_file, group_name, key, NULL);
-
- if (orig_value)
- {
- gboolean codeset_set;
- const gchar *translated;
- gboolean has_gettext;
-
- codeset_set = bind_textdomain_codeset (key_file->gettext_domain, "UTF-8") != NULL;
- translated = NULL;
-
- translated = g_dgettext (key_file->gettext_domain,
- orig_value);
- has_gettext = translated != orig_value;
-
- g_free (orig_value);
-
- if (has_gettext)
- {
- if (codeset_set)
- translated_value = g_strdup (translated);
- else
- translated_value = g_locale_to_utf8 (translated,
- -1, NULL, NULL, NULL);
- }
- else
- translated_value = NULL;
- }
- }
-
/* Fallback to untranslated key
*/
if (!translated_value)
diff --git a/glib/gkeyfile.h b/glib/gkeyfile.h
index aef9113b3..7a1004841 100644
--- a/glib/gkeyfile.h
+++ b/glib/gkeyfile.h
@@ -298,7 +298,6 @@ gboolean g_key_file_remove_group (GKeyFile *key_file,
/* Defines for handling freedesktop.org Desktop files */
#define G_KEY_FILE_DESKTOP_GROUP "Desktop Entry"
-#define G_KEY_FILE_DESKTOP_ACTION_GROUP_PREFIX "Desktop Action"
#define G_KEY_FILE_DESKTOP_KEY_TYPE "Type"
#define G_KEY_FILE_DESKTOP_KEY_VERSION "Version"
@@ -321,9 +320,6 @@ gboolean g_key_file_remove_group (GKeyFile *key_file,
#define G_KEY_FILE_DESKTOP_KEY_URL "URL"
#define G_KEY_FILE_DESKTOP_KEY_DBUS_ACTIVATABLE "DBusActivatable"
#define G_KEY_FILE_DESKTOP_KEY_ACTIONS "Actions"
-#define G_KEY_FILE_DESKTOP_KEY_GETTEXT_DOMAIN "X-GNOME-Gettext-Domain"
-#define G_KEY_FILE_DESKTOP_KEY_FULLNAME "X-GNOME-FullName"
-#define G_KEY_FILE_DESKTOP_KEY_KEYWORDS "Keywords"
#define G_KEY_FILE_DESKTOP_TYPE_APPLICATION "Application"
#define G_KEY_FILE_DESKTOP_TYPE_LINK "Link"
diff --git a/glib/gutils.c b/glib/gutils.c
index 951b63497..2e2d45785 100644
--- a/glib/gutils.c
+++ b/glib/gutils.c
@@ -797,9 +797,7 @@ g_build_home_dir (void)
gchar *home_dir;
/* We first check HOME and use it if it is set */
- home_dir = g_strdup (g_getenv ("G_HOME"));
- if (!home_dir)
- home_dir = g_strdup (g_getenv ("HOME"));
+ home_dir = g_strdup (g_getenv ("HOME"));
#ifdef G_OS_WIN32
/* Only believe HOME if it is an absolute path and exists.
@@ -887,12 +885,6 @@ g_build_home_dir (void)
* should either directly check the `HOME` environment variable yourself
* or unset it before calling any functions in GLib.
*
- * When the pre-2.36 behaviour was in effect, Debian provided the
- * <envar>G_HOME</envar> environment variable for testing and development
- * purposes. This is now unnecessary as <envar>HOME</envar> can be used
- * directly, but is retained for compatibility. It is deprecated and will be
- * removed in a future release.
- *
* Returns: (type filename): the current user's home directory
*/
const gchar *
diff --git a/glib/tests/gwakeuptest.c b/glib/tests/gwakeuptest.c
index 2c3eccd22..461a7d3de 100644
--- a/glib/tests/gwakeuptest.c
+++ b/glib/tests/gwakeuptest.c
@@ -89,9 +89,6 @@ struct context
#define NUM_TOKENS 5
#define TOKEN_TTL 100000
-static gint num_threads = NUM_THREADS;
-static gint token_ttl = TOKEN_TTL;
-
static struct context contexts[NUM_THREADS];
static GThread *threads[NUM_THREADS];
static GWakeup *last_token_wakeup;
@@ -161,7 +158,7 @@ dispatch_token (struct token *token)
struct context *ctx;
gint next_ctx;
- next_ctx = g_test_rand_int_range (0, num_threads);
+ next_ctx = g_test_rand_int_range (0, NUM_THREADS);
ctx = &contexts[next_ctx];
token->owner = ctx;
token->ttl--;
@@ -216,12 +213,6 @@ test_threaded (void)
{
gint i;
- if (!g_test_slow ())
- {
- num_threads = NUM_THREADS / 10;
- token_ttl = TOKEN_TTL / 10;
- }
-
/* make sure we don't block forever */
alarm (60);
@@ -239,7 +230,7 @@ test_threaded (void)
last_token_wakeup = g_wakeup_new ();
/* create contexts, assign to threads */
- for (i = 0; i < num_threads; i++)
+ for (i = 0; i < NUM_THREADS; i++)
{
context_init (&contexts[i]);
threads[i] = g_thread_new ("test", thread_func, &contexts[i]);
@@ -247,13 +238,13 @@ test_threaded (void)
/* dispatch tokens */
for (i = 0; i < NUM_TOKENS; i++)
- dispatch_token (token_new (token_ttl));
+ dispatch_token (token_new (TOKEN_TTL));
/* wait until all tokens are gone */
wait_for_signaled (last_token_wakeup);
/* ask threads to quit, join them, cleanup */
- for (i = 0; i < num_threads; i++)
+ for (i = 0; i < NUM_THREADS; i++)
{
context_quit (&contexts[i]);
g_thread_join (threads[i]);
diff --git a/glib/tests/mainloop.c b/glib/tests/mainloop.c
index 9beefd393..cf114fd40 100644
--- a/glib/tests/mainloop.c
+++ b/glib/tests/mainloop.c
@@ -168,14 +168,6 @@ test_timeouts (void)
GMainLoop *loop;
GSource *source;
-#if defined(__arm__)
- if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL)
- {
- g_test_skip ("Not reliable on older ARM hardware");
- return;
- }
-#endif
-
a = b = c = 0;
ctx = g_main_context_new ();
@@ -459,14 +451,6 @@ test_child_sources (void)
GMainLoop *loop;
GSource *parent, *child_b, *child_c, *end;
-#if defined(__arm__)
- if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL)
- {
- g_test_skip ("Not reliable on older ARM hardware");
- return;
- }
-#endif
-
ctx = g_main_context_new ();
loop = g_main_loop_new (ctx, FALSE);
@@ -545,14 +529,6 @@ test_recursive_child_sources (void)
GMainLoop *loop;
GSource *parent, *child_b, *child_c, *end;
-#if defined(__arm__)
- if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL)
- {
- g_test_skip ("Not reliable on older ARM hardware");
- return;
- }
-#endif
-
ctx = g_main_context_new ();
loop = g_main_loop_new (ctx, FALSE);
diff --git a/glib/tests/thread.c b/glib/tests/thread.c
index 43e682efa..b9f87967b 100644
--- a/glib/tests/thread.c
+++ b/glib/tests/thread.c
@@ -147,11 +147,8 @@ test_thread4 (void)
getrlimit (RLIMIT_NPROC, &nl);
nl.rlim_cur = 1;
- if ((ret = prlimit (getpid(), RLIMIT_NPROC, &nl, &ol)) != 0)
- {
- g_debug ("prlimit failed: %s\n", g_strerror (errno));
- return;
- }
+ if ((ret = prlimit (getpid (), RLIMIT_NPROC, &nl, &ol)) != 0)
+ g_error ("prlimit failed: %s", g_strerror (errno));
error = NULL;
thread = g_thread_try_new ("a", thread1_func, NULL, &error);
diff --git a/glib/tests/timeout.c b/glib/tests/timeout.c
index 430be918d..8f44e7552 100644
--- a/glib/tests/timeout.c
+++ b/glib/tests/timeout.c
@@ -175,15 +175,6 @@ test_func (gpointer data)
static void
test_rounding (void)
{
-
-#if defined(__arm__)
- if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") == NULL)
- {
- g_test_skip ("Not reliable on older ARM hardware");
- return;
- }
-#endif
-
loop = g_main_loop_new (NULL, FALSE);
last_time = g_get_monotonic_time ();
diff --git a/glib/tests/timer.c b/glib/tests/timer.c
index d5f5bbb1b..5b2e71144 100644
--- a/glib/tests/timer.c
+++ b/glib/tests/timer.c
@@ -27,7 +27,7 @@ static void
test_timer_basic (void)
{
GTimer *timer;
- volatile gdouble elapsed;
+ gdouble elapsed;
gulong micros;
timer = g_timer_new ();
@@ -44,7 +44,7 @@ static void
test_timer_stop (void)
{
GTimer *timer;
- volatile gdouble elapsed, elapsed2;
+ gdouble elapsed, elapsed2;
timer = g_timer_new ();
@@ -278,7 +278,7 @@ main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
-/* g_test_add_func ("/timer/basic", test_timer_basic);*/
+ g_test_add_func ("/timer/basic", test_timer_basic);
g_test_add_func ("/timer/stop", test_timer_stop);
g_test_add_func ("/timer/continue", test_timer_continue);
g_test_add_func ("/timer/reset", test_timer_reset);
diff --git a/tests/refcount/closures.c b/tests/refcount/closures.c
index 4e9bf364c..a4c283156 100644
--- a/tests/refcount/closures.c
+++ b/tests/refcount/closures.c
@@ -237,14 +237,6 @@ main (int argc,
GTest *object;
guint i;
-#if defined(__aarch64__) || defined(__arm__)
- if (g_getenv ("DEB_ALLOW_FLAKY_TESTS") != NULL)
- {
- g_print ("SKIP: Test is known to be flaky on arm* (#880883, #917983)\n");
- return 0;
- }
-#endif
-
g_print ("START: %s\n", argv[0]);
g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment