Commit 9bf4ecef authored by Richard Hughes's avatar Richard Hughes

trivial: Include the fwupd version in the useragent

See https://blogs.gnome.org/hughsie/2018/02/16/ for more details.
parent 47520845
...@@ -9,6 +9,7 @@ AM_CPPFLAGS = \ ...@@ -9,6 +9,7 @@ AM_CPPFLAGS = \
$(PACKAGEKIT_CFLAGS) \ $(PACKAGEKIT_CFLAGS) \
$(GNOME_DESKTOP_CFLAGS) \ $(GNOME_DESKTOP_CFLAGS) \
$(POLKIT_CFLAGS) \ $(POLKIT_CFLAGS) \
$(FWUPD_CFLAGS) \
$(LIBSECRET_CFLAGS) \ $(LIBSECRET_CFLAGS) \
-DG_LOG_DOMAIN=\"Gs\" \ -DG_LOG_DOMAIN=\"Gs\" \
-DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \ -DI_KNOW_THE_PACKAGEKIT_GLIB2_API_IS_SUBJECT_TO_CHANGE \
......
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
#include <polkit/polkit.h> #include <polkit/polkit.h>
#endif #endif
#ifdef HAVE_FIRMWARE
#include <fwupd.h>
#endif
#include "gs-app.h" #include "gs-app.h"
#include "gs-utils.h" #include "gs-utils.h"
#include "gs-plugin.h" #include "gs-plugin.h"
...@@ -409,7 +413,20 @@ gs_utils_get_file_age (GFile *file) ...@@ -409,7 +413,20 @@ gs_utils_get_file_age (GFile *file)
const gchar * const gchar *
gs_user_agent (void) 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; 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