[gnome-software/wip/rancell/apt] Fix wrong parameters being passed to aptd



commit 404c693a17c4226e57b37470ef317412f04911b3
Author: Robert Ancell <robert ancell canonical com>
Date:   Fri Mar 4 15:37:34 2016 +1300

    Fix wrong parameters being passed to aptd

 src/plugins/gs-plugin-apt.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/plugins/gs-plugin-apt.c b/src/plugins/gs-plugin-apt.c
index 7aa95ef..fd814c0 100644
--- a/src/plugins/gs-plugin-apt.c
+++ b/src/plugins/gs-plugin-apt.c
@@ -620,10 +620,13 @@ aptd_transaction (GsPlugin *plugin, const gchar *method, GsApp *app, GError **er
                return FALSE;
 
        if (g_strcmp0 (method, "InstallFile") == 0)
-               parameters = g_variant_new_parsed ("(%s, true)", gs_app_get_origin (app));
-       else if (app != NULL)
-               parameters = g_variant_new_parsed ("[%s]", gs_app_get_source_default (app));
-       else
+               parameters = g_variant_new ("(sb)", gs_app_get_origin (app), TRUE);
+       else if (app != NULL) {
+               GVariantBuilder builder;
+               g_variant_builder_init (&builder, G_VARIANT_TYPE ("as")),
+               g_variant_builder_add (&builder, "s", gs_app_get_source_default (app));
+               parameters = g_variant_new ("(as)", &builder);
+       } else
                parameters = g_variant_new ("()");
        result = g_dbus_connection_call_sync (conn,
                                              "org.debian.apt",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]