diff --git a/.gitignore b/.gitignore index 3290936..75bc5e5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ /fwupd-0.1.4.tar.xz /fwupd-0.1.5.tar.xz /fwupd-0.1.6.tar.xz +/fwupd-0.5.0.tar.xz diff --git a/0001-Do-not-merge-the-existing-firmware-metadata-with-the.patch b/0001-Do-not-merge-the-existing-firmware-metadata-with-the.patch deleted file mode 100644 index 4955a31..0000000 --- a/0001-Do-not-merge-the-existing-firmware-metadata-with-the.patch +++ /dev/null @@ -1,165 +0,0 @@ -From 033ccba050c2d0f3e83461af211d5f99dac95404 Mon Sep 17 00:00:00 2001 -From: Richard Hughes -Date: Thu, 10 Sep 2015 14:51:28 +0100 -Subject: [PATCH] Do not merge the existing firmware metadata with the - submitted files - -This just causes confusion and makes things hard to debug. ---- - src/fu-main.c | 84 ++++++++++++++++++++++++++++++++--------------------------- - 1 file changed, 45 insertions(+), 39 deletions(-) - -diff --git a/src/fu-main.c b/src/fu-main.c -index 464be03..512e405 100644 ---- a/src/fu-main.c -+++ b/src/fu-main.c -@@ -63,6 +63,7 @@ typedef struct { - FwupdStatus status; - FuPending *pending; - AsStore *store; -+ guint store_changed_id; - } FuMainPrivate; - - typedef struct { -@@ -575,23 +576,6 @@ fu_main_get_action_id_for_device (FuMainAuthHelper *helper) - } - - /** -- * _as_store_set_priority: -- **/ --static void --_as_store_set_priority (AsStore *store, gint priority) --{ -- AsApp *app; -- GPtrArray *apps; -- guint i; -- -- apps = as_store_get_apps (store); -- for (i = 0; i < apps->len; i++) { -- app = g_ptr_array_index (apps, i); -- as_app_set_priority (app, priority); -- } --} -- --/** - * fu_main_daemon_update_metadata: - * - * Supports optionally GZipped AppStream files up to 1MiB in size. -@@ -603,7 +587,6 @@ fu_main_daemon_update_metadata (FuMainPrivate *priv, gint fd, gint fd_sig, GErro - _cleanup_bytes_unref_ GBytes *bytes = NULL; - _cleanup_bytes_unref_ GBytes *bytes_raw = NULL; - _cleanup_bytes_unref_ GBytes *bytes_sig = NULL; -- _cleanup_object_unref_ AsStore *store = NULL; - _cleanup_object_unref_ FuKeyring *kr = NULL; - _cleanup_object_unref_ GConverter *converter = NULL; - _cleanup_object_unref_ GFile *file = NULL; -@@ -612,16 +595,6 @@ fu_main_daemon_update_metadata (FuMainPrivate *priv, gint fd, gint fd_sig, GErro - _cleanup_object_unref_ GInputStream *stream = NULL; - _cleanup_object_unref_ GInputStream *stream_sig = NULL; - -- /* open existing file if it exists */ -- store = as_store_new (); -- file = g_file_new_for_path ("/var/cache/app-info/xmls/fwupd.xml"); -- if (g_file_query_exists (file, NULL)) { -- if (!as_store_from_file (store, file, NULL, NULL, error)) -- return FALSE; -- /* ensure we don't merge existing entries */ -- _as_store_set_priority (store, -1); -- } -- - /* read the entire file into memory */ - stream_fd = g_unix_input_stream_new (fd, TRUE); - bytes_raw = g_input_stream_read_bytes (stream_fd, 0x100000, NULL, error); -@@ -668,16 +641,16 @@ fu_main_daemon_update_metadata (FuMainPrivate *priv, gint fd, gint fd_sig, GErro - return FALSE; - - /* merge in the new contents */ -- g_debug ("Store was %i size", as_store_get_size (store)); -- if (!as_store_from_xml (store, -+ as_store_remove_all (priv->store); -+ if (!as_store_from_xml (priv->store, - g_bytes_get_data (bytes, NULL), - NULL, error)) - return FALSE; -- g_debug ("Store now %i size", as_store_get_size (store)); - - /* save the new file */ -- as_store_set_api_version (store, 0.9); -- if (!as_store_to_file (store, file, -+ as_store_set_api_version (priv->store, 0.9); -+ file = g_file_new_for_path ("/var/cache/app-info/xmls/fwupd.xml"); -+ if (!as_store_to_file (priv->store, file, - AS_NODE_TO_XML_FLAG_ADD_HEADER | - AS_NODE_TO_XML_FLAG_FORMAT_MULTILINE | - AS_NODE_TO_XML_FLAG_FORMAT_INDENT, -@@ -685,14 +658,41 @@ fu_main_daemon_update_metadata (FuMainPrivate *priv, gint fd, gint fd_sig, GErro - return FALSE; - } - -- /* force the store to reload */ -- if (!as_store_load (priv->store, -- AS_STORE_LOAD_FLAG_APP_INFO_SYSTEM, -- NULL, error)) { -- return FALSE; -+ return TRUE; -+} -+ -+/** -+ * fu_main_store_delay_cb: -+ **/ -+static gboolean -+fu_main_store_delay_cb (gpointer user_data) -+{ -+ AsApp *app; -+ GPtrArray *apps; -+ guint i; -+ FuMainPrivate *priv = (FuMainPrivate *) user_data; -+ -+ g_debug ("devices now in store:"); -+ apps = as_store_get_apps (priv->store); -+ for (i = 0; i < apps->len; i++) { -+ app = g_ptr_array_index (apps, i); -+ g_debug ("%i\t%s\t%s", i + 1, -+ as_app_get_id (app), -+ as_app_get_name (app, NULL)); - } -+ priv->store_changed_id = 0; -+ return G_SOURCE_REMOVE; -+} - -- return TRUE; -+/** -+ * fu_main_store_changed_cb: -+ **/ -+static void -+fu_main_store_changed_cb (AsStore *store, FuMainPrivate *priv) -+{ -+ if (priv->store_changed_id != 0) -+ return; -+ priv->store_changed_id = g_timeout_add (200, fu_main_store_delay_cb, priv); - } - - /** -@@ -1519,6 +1519,10 @@ main (int argc, char *argv[]) - priv->loop = g_main_loop_new (NULL, FALSE); - priv->pending = fu_pending_new (); - priv->store = as_store_new (); -+ g_signal_connect (priv->store, "changed", -+ G_CALLBACK (fu_main_store_changed_cb), priv); -+ as_store_set_watch_flags (priv->store, AS_STORE_WATCH_FLAG_ADDED | -+ AS_STORE_WATCH_FLAG_REMOVED); - - /* load AppStream */ - as_store_add_filter (priv->store, AS_ID_KIND_FIRMWARE); -@@ -1612,6 +1616,8 @@ out: - g_object_unref (priv->store); - if (priv->introspection_daemon != NULL) - g_dbus_node_info_unref (priv->introspection_daemon); -+ if (priv->store_changed_id != 0) -+ g_source_remove (priv->store_changed_id); - g_object_unref (priv->pending); - if (priv->providers != NULL) - g_ptr_array_unref (priv->providers); --- -2.4.3 - diff --git a/fwupd.spec b/fwupd.spec index c8c4ba8..fb768f5 100644 --- a/fwupd.spec +++ b/fwupd.spec @@ -1,17 +1,14 @@ Summary: Firmware update daemon Name: fwupd -Version: 0.1.6 -Release: 3%{?dist} +Version: 0.5.0 +Release: 1%{?dist} License: GPLv2+ URL: https://github.com/hughsie/fwupd Source0: http://people.freedesktop.org/~hughsient/releases/%{name}-%{version}.tar.xz -# Already upstream -Patch1: 0001-Do-not-merge-the-existing-firmware-metadata-with-the.patch - BuildRequires: docbook-utils BuildRequires: gettext -BuildRequires: glib2-devel +BuildRequires: glib2-devel >= 2.45.8 BuildRequires: intltool BuildRequires: libgudev1-devel BuildRequires: colord-devel >= 1.0.0 @@ -20,7 +17,7 @@ BuildRequires: libgcab1-devel BuildRequires: sqlite-devel BuildRequires: gpgme-devel BuildRequires: systemd -BuildRequires: libsoup-devel +BuildRequires: libsoup-devel >= 2.51.92 BuildRequires: libarchive-devel BuildRequires: gobject-introspection-devel BuildRequires: libappstream-glib-devel >= 0.5.0 @@ -48,7 +45,6 @@ Files for development with %{name}. %prep %setup -q -%patch1 -p1 -b .no-merge-fw %build %configure \ @@ -112,6 +108,10 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';' %{_datadir}/gir-1.0/*.gir %changelog +* Tue Sep 15 2015 Richard Hughes 0.5.0-1 +- New upstream release +- Do not reboot if racing with the PackageKit offline update mechanism + * Thu Sep 10 2015 Richard Hughes 0.1.6-3 - Do not merge the existing firmware metadata with the submitted files diff --git a/sources b/sources index 0480e50..f806dfa 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -81551ee30bc062257583393474f375c4 fwupd-0.1.6.tar.xz +8ff54e0856be142a6ba1c7ff7c5d42f5 fwupd-0.5.0.tar.xz