[gnome-software/wip/hughsie/flatpak] f



commit b5a1fd44dd8537c2c41a7ca0de2104fad93859b4
Author: Richard Hughes <richard hughsie com>
Date:   Fri May 13 08:57:12 2016 +0100

    f

 data/tests/flatpak/build-flatpak.sh |    1 +
 src/gs-self-test.c                  |   11 ++++++-----
 src/plugins/gs-plugin-flatpak.c     |    9 +++++++++
 3 files changed, 16 insertions(+), 5 deletions(-)
---
diff --git a/data/tests/flatpak/build-flatpak.sh b/data/tests/flatpak/build-flatpak.sh
index 63d87f6..673b2b9 100755
--- a/data/tests/flatpak/build-flatpak.sh
+++ b/data/tests/flatpak/build-flatpak.sh
@@ -1,4 +1,5 @@
 rm -rf repo
+rm chiron/export -rf
 flatpak build-finish chiron
 flatpak build-export repo chiron
 appstream-compose --origin=flatpak --basename=org.test.Chiron --prefix=chiron/files 
--output-dir=chiron/files/share/app-info/xmls org.test.Chiron
diff --git a/src/gs-self-test.c b/src/gs-self-test.c
index 8029427..aee5d09 100644
--- a/src/gs-self-test.c
+++ b/src/gs-self-test.c
@@ -711,14 +711,14 @@ gs_plugin_loader_flatpak_func (GsPluginLoader *plugin_loader)
        //XDG_DATA_HOME=/var/tmp/self-test flatpak remote-add --user --no-gpg-verify test 
../data/tests/flatpak/repo/
        testdir = gs_test_get_filename ("tests/flatpak");
        g_assert (testdir != NULL);
-       argv = g_new0 (gchar *, 7);
+       argv = g_new0 (gchar *, 8);
        argv[0] = g_strdup ("/usr/bin/flatpak");
        argv[1] = g_strdup ("--user");
        argv[2] = g_strdup ("--no-gpg-verify");
-       argv[2] = g_strdup ("--if-not-exists");
-       argv[3] = g_strdup ("remote-add");
-       argv[4] = g_strdup ("test");
-       argv[5] = g_build_filename (testdir, "repo", NULL);
+       argv[3] = g_strdup ("--if-not-exists");
+       argv[4] = g_strdup ("remote-add");
+       argv[5] = g_strdup ("test");
+       argv[6] = g_build_filename (testdir, "repo", NULL);
        ret = g_spawn_sync (NULL, argv, envp, G_SPAWN_DEFAULT, NULL, NULL,
                            NULL, NULL, &rc, &error);
        g_assert_no_error (error);
@@ -777,6 +777,7 @@ if(0)       gs_test_idle_delay (1000);
        g_assert_cmpint (gs_app_get_state (app), ==, AS_APP_STATE_AVAILABLE);
 
        /* install */
+       //XDG_DATA_HOME=/var/tmp/self-test flatpak --user install test org.test.Chiron
        ret = gs_plugin_loader_app_action (plugin_loader, app,
                                           GS_PLUGIN_LOADER_ACTION_INSTALL,
                                           NULL,
diff --git a/src/plugins/gs-plugin-flatpak.c b/src/plugins/gs-plugin-flatpak.c
index 42ef6ea..b0c46bc 100644
--- a/src/plugins/gs-plugin-flatpak.c
+++ b/src/plugins/gs-plugin-flatpak.c
@@ -1151,6 +1151,9 @@ gs_plugin_flatpak_refine_app (GsPlugin *plugin,
                                  "flatpak::refine{%s}",
                                  gs_app_get_id (app));
 
+       /* flatpak apps can always be removed */
+       gs_app_remove_quirk (app, AS_APP_QUIRK_COMPULSORY);
+
        /* AppStream sets the source to appname/arch/branch */
        if (!gs_plugin_refine_item_metadata (plugin, app, cancellable, error))
                return FALSE;
@@ -1261,6 +1264,12 @@ gs_plugin_app_remove (GsPlugin *plugin,
 
        /* state is not known: we don't know if we can re-install this app */
        gs_app_set_state (app, AS_APP_STATE_UNKNOWN);
+
+       /* refresh the state */
+       if (!gs_plugin_refine_item_state (plugin, app, cancellable, error))
+               return FALSE;
+
+       /* success */
        return TRUE;
 }
 


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