From a4a25a4a64b0f37b2c8e7d56927c9241c23161a0 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 24 Jan 2015 22:19:44 -0500 Subject: [PATCH 1/2] Add some debug output to the run command Show where the used applications and runtimes are located. --- xdg-app-builtins-run.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xdg-app-builtins-run.c b/xdg-app-builtins-run.c index 4da82d2e..01509782 100644 --- a/xdg-app-builtins-run.c +++ b/xdg-app-builtins-run.c @@ -242,6 +242,7 @@ xdg_app_builtin_run (int argc, char **argv, GCancellable *cancellable, GError ** gs_free char *default_command = NULL; gs_free char *runtime_ref = NULL; gs_free char *app_ref = NULL; + gs_free char *path = NULL; gs_unref_keyfile GKeyFile *metakey = NULL; gs_unref_keyfile GKeyFile *runtime_metakey = NULL; gs_free_error GError *my_error = NULL; @@ -291,6 +292,9 @@ xdg_app_builtin_run (int argc, char **argv, GCancellable *cancellable, GError ** if (app_deploy == NULL) goto out; + path = g_file_get_path (app_deploy); + g_debug ("Running application in %s", path); + metadata = g_file_get_child (app_deploy, "metadata"); if (!g_file_load_contents (metadata, cancellable, &metadata_contents, &metadata_size, NULL, error)) goto out; @@ -315,6 +319,10 @@ xdg_app_builtin_run (int argc, char **argv, GCancellable *cancellable, GError ** if (runtime_deploy == NULL) goto out; + g_free (path); + path = g_file_get_path (runtime_deploy); + g_debug ("Using runtime in %s", path); + runtime_metadata = g_file_get_child (runtime_deploy, "metadata"); if (g_file_load_contents (runtime_metadata, cancellable, &runtime_metadata_contents, &runtime_metadata_size, NULL, error)) { From 45aabf06d9b4cad986d5cafa6b64fd28c28d5264 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 25 Jan 2015 11:07:03 -0500 Subject: [PATCH 2/2] Don't leak an ignored error Runtime metadata is optional, so don't leak an error we get when the file is not found. Properly ignore it by passing NULL as the error. --- xdg-app-builtins-run.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xdg-app-builtins-run.c b/xdg-app-builtins-run.c index 01509782..606c3a54 100644 --- a/xdg-app-builtins-run.c +++ b/xdg-app-builtins-run.c @@ -324,7 +324,7 @@ xdg_app_builtin_run (int argc, char **argv, GCancellable *cancellable, GError ** g_debug ("Using runtime in %s", path); runtime_metadata = g_file_get_child (runtime_deploy, "metadata"); - if (g_file_load_contents (runtime_metadata, cancellable, &runtime_metadata_contents, &runtime_metadata_size, NULL, error)) + if (g_file_load_contents (runtime_metadata, cancellable, &runtime_metadata_contents, &runtime_metadata_size, NULL, NULL)) { runtime_metakey = g_key_file_new ();