trivial: back the requirement on appstream-glib to 0.6.9

The items that 0.6.13 requires are now guarded by a version test.
This should allow running fwupd master on more distros that haven't
yet picked up appstream-glib 0.6.13.
This commit is contained in:
Mario Limonciello 2017-07-10 14:32:42 -05:00
parent e68b118044
commit dc8c985159
4 changed files with 12 additions and 1 deletions

View File

@ -125,7 +125,7 @@ if polkit.version() >= '0.114'
conf.set('HAVE_POLKIT_0_114', '1')
endif
gudev = dependency('gudev-1.0')
appstream_glib = dependency('appstream-glib', version : '>= 0.6.13')
appstream_glib = dependency('appstream-glib', version : '>= 0.6.9')
gusb = dependency('gusb', version : '>= 0.2.9')
sqlite = dependency('sqlite3')
libarchive = dependency('libarchive')

View File

@ -2195,6 +2195,7 @@ fu_engine_plugin_set_coldplug_delay_cb (FuPlugin *plugin, guint duration, FuEngi
duration, self->coldplug_delay);
}
#if AS_CHECK_VERSION(0,6,13)
static gboolean
fu_engine_load_hwids (FuEngine *self, GError **error)
{
@ -2229,6 +2230,7 @@ fu_engine_load_hwids (FuEngine *self, GError **error)
return TRUE;
}
#endif
static gboolean
fu_engine_load_plugins (FuEngine *self, GError **error)
@ -2388,11 +2390,13 @@ fu_engine_load (FuEngine *self, GError **error)
return FALSE;
}
#if AS_CHECK_VERSION(0,6,13)
/* load the hwids */
if (!fu_engine_load_hwids (self, error)) {
g_prefix_error (error, "Failed to load hwids: ");
return FALSE;
}
#endif
/* delete old data files */
if (!fu_engine_cleanup_state (error)) {

View File

@ -21,6 +21,7 @@
#include "config.h"
#include <appstream-glib.h>
#include <fwupd.h>
#include <glib-object.h>
#include <glib/gstdio.h>
@ -33,6 +34,7 @@
#include "fu-hwids.h"
#include "fu-test.h"
#if AS_CHECK_VERSION(0,6,13)
static void
fu_hwids_func (void)
{
@ -93,6 +95,7 @@ fu_hwids_func (void)
g_assert_cmpstr (guid, ==, guids[i].value);
}
}
#endif
static void
_plugin_status_changed_cb (FuPlugin *plugin, FwupdStatus status, gpointer user_data)
@ -422,7 +425,9 @@ main (int argc, char **argv)
g_assert_cmpint (g_mkdir_with_parents ("/tmp/fwupd-self-test/var/lib/fwupd", 0755), ==, 0);
/* tests go here */
#if AS_CHECK_VERSION(0,6,13)
g_test_add_func ("/fwupd/hwids", fu_hwids_func);
#endif
g_test_add_func ("/fwupd/pending", fu_pending_func);
g_test_add_func ("/fwupd/plugin{delay}", fu_plugin_delay_func);
g_test_add_func ("/fwupd/plugin{module}", fu_plugin_module_func);

View File

@ -1635,12 +1635,14 @@ main (int argc, char *argv[])
/* TRANSLATORS: command description */
_("Get all devices that support firmware updates"),
fu_util_get_devices);
#if AS_CHECK_VERSION(0,6,13)
fu_util_add (priv->cmd_array,
"hwids",
NULL,
/* TRANSLATORS: command description */
_("Return all the hardware IDs for the machine"),
fu_util_hwids);
#endif
fu_util_add (priv->cmd_array,
"install-prepared",
NULL,