From 5db7ddb209d4cae037245a0386fbbde18b737693 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 16 Jun 2022 12:45:48 -0700 Subject: [PATCH] ui: Add Logwolf software updates. Set Logwolf information in the Appcast URL template as needed. --- cmakeconfig.h.in | 5 ++++- ui/software_update.c | 14 ++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index 315c0526f5..469ada8d92 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -10,12 +10,15 @@ #define VERSION_EXTRA "$ENV{WIRESHARK_VERSION_EXTRA}" -/* Version number of package */ +/* Version number of Wireshark and associated utilities */ #define VERSION "${PROJECT_VERSION}${VERSION_EXTRA}" #define VERSION_MAJOR ${PROJECT_MAJOR_VERSION} #define VERSION_MINOR ${PROJECT_MINOR_VERSION} #define VERSION_MICRO ${PROJECT_PATCH_VERSION} +/* Version number of Logwolf and associated utilities */ +#define LOG_VERSION "${LOG_PROJECT_VERSION}${VERSION_EXTRA}" + #define PLUGIN_PATH_ID "${PLUGIN_PATH_ID}" #define VERSION_FLAVOR "${VERSION_FLAVOR}" diff --git a/ui/software_update.c b/ui/software_update.c index 925f39092f..d654fcc11f 100644 --- a/ui/software_update.c +++ b/ui/software_update.c @@ -13,12 +13,13 @@ #include "software_update.h" #include "language.h" #include "../epan/prefs.h" +#include "../wsutil/filesystem.h" /* * Version 0 of the update URI path has the following elements: * - The update path prefix (fixed, "update") * - The schema version (fixed, 0) - * - The application name (fixed, "Wireshark") + * - The application name (variable, "Wireshark" or "Logwolf") * - The application version ("..") * - The operating system (variable, one of "Windows" or "macOS") * - The architecture name (variable, one of "x86", "x86-64", or "arm64") @@ -34,7 +35,6 @@ #ifdef HAVE_SOFTWARE_UPDATE #define SU_SCHEMA_PREFIX "update" #define SU_SCHEMA_VERSION 0 -#define SU_APPLICATION "Wireshark" #define SU_LOCALE "en-US" #endif /* HAVE_SOFTWARE_UPDATE */ @@ -66,6 +66,12 @@ static char *get_appcast_update_url(software_update_channel_e chan) { GString *update_url_str = g_string_new("");; const char *chan_name; + const char *su_application = get_configuration_namespace(); + const char *su_version = VERSION; + + if (g_str_has_prefix(su_application, "Log")) { + su_version = LOG_VERSION; + } switch (chan) { case UPDATE_CHANNEL_DEVELOPMENT: @@ -78,8 +84,8 @@ static char *get_appcast_update_url(software_update_channel_e chan) { g_string_printf(update_url_str, "https://www.wireshark.org/%s/%u/%s/%s/%s/%s/en-US/%s.xml", SU_SCHEMA_PREFIX, SU_SCHEMA_VERSION, - SU_APPLICATION, - VERSION, + su_application, + su_version, SU_OSNAME, SU_ARCH, chan_name);