[gnome-software] Don't hardcode the LVFS location



commit f535c13dbca91066c68bbabf26397389a2538eed
Author: Richard Hughes <richard hughsie com>
Date:   Tue Aug 4 15:00:44 2015 +0100

    Don't hardcode the LVFS location
    
    Grab the value from the fwupd config file instead.

 src/plugins/gs-plugin-fwupd.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/gs-plugin-fwupd.c b/src/plugins/gs-plugin-fwupd.c
index fd14689..c8d7372 100644
--- a/src/plugins/gs-plugin-fwupd.c
+++ b/src/plugins/gs-plugin-fwupd.c
@@ -599,16 +599,29 @@ gs_plugin_fwupd_check_lvfs_metadata (GsPlugin *plugin,
                                     GCancellable *cancellable,
                                     GError **error)
 {
-       const gchar *url_data = "https://beta-lvfs.rhcloud.com/downloads/firmware.xml.gz";;
        guint status_code;
        _cleanup_error_free_ GError *error_local = NULL;
        _cleanup_free_ gchar *basename_data = NULL;
        _cleanup_free_ gchar *cache_fn_data = NULL;
        _cleanup_free_ gchar *checksum = NULL;
+       _cleanup_free_ gchar *config_fn = NULL;
+       _cleanup_free_ gchar *url_data = NULL;
        _cleanup_free_ gchar *url_sig = NULL;
+       _cleanup_keyfile_unref_ GKeyFile *config = NULL;
        _cleanup_object_unref_ SoupMessage *msg_data = NULL;
        _cleanup_object_unref_ SoupMessage *msg_sig = NULL;
 
+       /* read config file */
+       config = g_key_file_new ();
+       config_fn = g_build_filename (SYSCONFDIR, "fwupd.conf", NULL);
+       if (!g_key_file_load_from_file (config, config_fn, G_KEY_FILE_NONE, error))
+               return FALSE;
+
+       /* download the signature */
+       url_data = g_key_file_get_string (config, "fwupd", "DownloadURI", error);
+       if (url_data == NULL)
+               return FALSE;
+
        /* download the signature first, it's smaller */
        url_sig = g_strdup_printf ("%s.asc", url_data);
        msg_sig = soup_message_new (SOUP_METHOD_GET, url_sig);



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