diff options
author | Richard Hughes <richard@hughsie.com> | 2016-05-12 18:26:50 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2016-05-12 18:26:50 +0100 |
commit | a852822fe2037c6b9c43984b5bd38c952f3a6abe (patch) | |
tree | 93da8f5fabefbda42bd15aa129ee9173f10ee148 | |
parent | 2669543fd8a3db2edcd870d9493e828cca5a6592 (diff) | |
download | appstream-glib-a852822fe2037c6b9c43984b5bd38c952f3a6abe.tar.gz |
trivial: Add some support for flatpak self tests
-rw-r--r-- | libappstream-glib/as-store.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libappstream-glib/as-store.c b/libappstream-glib/as-store.c index 9984786..b24c9d8 100644 --- a/libappstream-glib/as-store.c +++ b/libappstream-glib/as-store.c @@ -2523,6 +2523,7 @@ as_store_search_per_system (AsStore *store, /* flatpak */ if ((flags & AS_STORE_LOAD_FLAG_FLATPAK_SYSTEM) > 0) { + const gchar *tmp; if ((flags & AS_STORE_LOAD_FLAG_APPDATA) > 0) { g_autofree gchar *dest = NULL; dest = g_build_filename (LOCALSTATEDIR, @@ -2559,6 +2560,20 @@ as_store_search_per_system (AsStore *store, return FALSE; as_store_monitor_flatpak_dir (store, dest, "flatpak"); } + + /* for self tests */ + tmp = g_getenv ("AS_GLIB_FLATPAK_EXTRA_DATADIR"); + if (tmp != NULL) { + g_autofree gchar *dest = NULL; + dest = g_build_filename (tmp, + "flatpak", + "appstream", + NULL); + if (!as_store_search_flatpaks (store, flags, "flatpak", + dest, cancellable, error)) + return FALSE; + as_store_monitor_flatpak_dir (store, dest, "flatpak"); + } } /* datadir AppStream, AppData and desktop */ |