app: use GIMP_BUILD_PLATFORM_FAMILY instead of GIMP_BUILD_PLATFORM.

I didn't realize it because the meson build was returning 'windows' for
GIMP_BUILD_PLATFORM when I cross-built with Mingw-w64. But in the
autotools, it was storing "mingw32", which would not compare with our
gimp_versions.json. Therefore in GIMP 2.10.16, the version update check
would have worked, but not the revision check.
This fixes the problem.
This commit is contained in:
Jehan 2020-02-22 19:54:15 +01:00
parent 1b6191d176
commit a5ea6d6b9b
2 changed files with 9 additions and 9 deletions

View File

@ -89,7 +89,7 @@ gimp_check_updates_callback (GObject *source,
stream = g_file_read_finish (G_FILE (source), result, &error); stream = g_file_read_finish (G_FILE (source), result, &error);
if (stream) if (stream)
{ {
const gchar *build_platform; const gchar *platform;
const gchar *last_version = NULL; const gchar *last_version = NULL;
const gchar *release_date = NULL; const gchar *release_date = NULL;
JsonParser *parser; JsonParser *parser;
@ -106,11 +106,11 @@ gimp_check_updates_callback (GObject *source,
/* For Windows and macOS, let's look if installers are available. /* For Windows and macOS, let's look if installers are available.
* For other platforms, let's just look for source release. * For other platforms, let's just look for source release.
*/ */
if (g_strcmp0 (GIMP_BUILD_PLATFORM, "windows") == 0 || if (g_strcmp0 (GIMP_BUILD_PLATFORM_FAMILY, "windows") == 0 ||
g_strcmp0 (GIMP_BUILD_PLATFORM, "macos") == 0) g_strcmp0 (GIMP_BUILD_PLATFORM_FAMILY, "macos") == 0)
build_platform = GIMP_BUILD_PLATFORM; platform = GIMP_BUILD_PLATFORM_FAMILY;
else else
build_platform = "source"; platform = "source";
parser = json_parser_new (); parser = json_parser_new ();
if (! json_parser_load_from_stream (parser, G_INPUT_STREAM (stream), NULL, &error)) if (! json_parser_load_from_stream (parser, G_INPUT_STREAM (stream), NULL, &error))
@ -129,7 +129,7 @@ gimp_check_updates_callback (GObject *source,
path = json_path_new (); path = json_path_new ();
/* Ideally we could just use Json path filters like this to /* Ideally we could just use Json path filters like this to
* retrieve only released binaries for a given platform: * retrieve only released binaries for a given platform:
* g_strdup_printf ("$['STABLE'][?(@.%s)]['version']", build_platform); * g_strdup_printf ("$['STABLE'][?(@.%s)]['version']", platform);
* json_array_get_string_element (result, 0); * json_array_get_string_element (result, 0);
* And that would be it! We'd have our last release for given * And that would be it! We'd have our last release for given
* platform. * platform.
@ -160,11 +160,11 @@ gimp_check_updates_callback (GObject *source,
* platform is available. * platform is available.
*/ */
version = json_array_get_object_element (versions, i); version = json_array_get_object_element (versions, i);
if (json_object_has_member (version, build_platform)) if (json_object_has_member (version, platform))
{ {
last_version = json_object_get_string_member (version, "version"); last_version = json_object_get_string_member (version, "version");
release_date = json_object_get_string_member (version, "date"); release_date = json_object_get_string_member (version, "date");
builds = json_object_get_array_member (version, build_platform); builds = json_object_get_array_member (version, platform);
break; break;
} }
} }

View File

@ -229,7 +229,7 @@ gimp_version (gboolean be_verbose,
GIMP_GIT_VERSION, GIMP_GIT_VERSION,
GIMP_BUILD_ID, GIMP_BUILD_ID,
gimp_version_get_revision (), gimp_version_get_revision (),
GIMP_BUILD_PLATFORM, GIMP_BUILD_PLATFORM_FAMILY,
CC_VERSION, CC_VERSION,
lib_versions); lib_versions);
g_free (lib_versions); g_free (lib_versions);