[gnome-boxes/flatpak-load-libosinfo-db] os-database: Load osinfo db from hardcoded path for Flatpak



commit 929848c3be9cd11f1f25f44f982e8e611238fdb5
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue Dec 3 15:02:21 2019 +0100

    os-database: Load osinfo db from hardcoded path for Flatpak
    
    Libosinfo's latest release has introduced a regression causing
    osinfo_db_loader_process_default_path to fail in a Flatpak container.
    
    Until we manage to track this down and fix it in libosinfo, we can
    hardcode the path and restore the functionality. Otherwise Boxes
    crashes whenever it needs to query libosinfo (which is pretty bad).

 src/os-database.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/os-database.vala b/src/os-database.vala
index c6f202ec..a9eb248f 100644
--- a/src/os-database.vala
+++ b/src/os-database.vala
@@ -56,7 +56,11 @@ public async void load () {
         db_loading = true;
         var loader = new Loader ();
         try {
+#if FLATPAK
+            yield App.app.async_launcher.launch (() => { loader.process_path ("/app/share/osinfo"); });
+#else
             yield App.app.async_launcher.launch (() => { loader.process_default_path (); });
+#endif
         } catch (GLib.Error e) {
             warning ("Error loading default libosinfo database: %s", e.message);
         }


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