ui: Add Logwolf software updates.

Set Logwolf information in the Appcast URL template as needed.
This commit is contained in:
Gerald Combs 2022-06-16 12:45:48 -07:00
parent e11c7559a8
commit 5db7ddb209
2 changed files with 14 additions and 5 deletions

View File

@ -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}"

View File

@ -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 ("<major>.<minor>.<micro>")
* - 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);