Commit 9bf4ecef by Richard Hughes

trivial: Include the fwupd version in the useragent

parent 47520845
......@@ -9,6 +9,7 @@ AM_CPPFLAGS = \
$(PACKAGEKIT_CFLAGS) \
$(GNOME_DESKTOP_CFLAGS) \
$(POLKIT_CFLAGS) \
$(FWUPD_CFLAGS) \
$(LIBSECRET_CFLAGS) \
-DG_LOG_DOMAIN=\"Gs\" \
-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \
......
......@@ -29,6 +29,10 @@
#include <polkit/polkit.h>
#endif
#ifdef HAVE_FIRMWARE
#include <fwupd.h>
#endif
#include "gs-app.h"
#include "gs-utils.h"
#include "gs-plugin.h"
......@@ -409,7 +413,20 @@ gs_utils_get_file_age (GFile *file)
const gchar *
gs_user_agent (void)
{
#ifdef HAVE_FIRMWARE
static gchar *user_agent = NULL;
if (user_agent == NULL) {
user_agent = g_strdup_printf ("%s/%s fwupd/%i.%i.%i",
PACKAGE_NAME,
PACKAGE_VERSION,
FWUPD_MAJOR_VERSION,
FWUPD_MINOR_VERSION,
FWUPD_MICRO_VERSION);
}
return user_agent;
#else
return PACKAGE_NAME "/" PACKAGE_VERSION;
#endif
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment