[gimp] app: use GIMP_BUILD_PLATFORM_FAMILY instead of GIMP_BUILD_PLATFORM.



commit a5ea6d6b9bc1f14e5e81287a8ca04a58b9411cb4
Author: Jehan <jehan girinstud io>
Date:   Sat Feb 22 19:54:15 2020 +0100

    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.

 app/gimp-update.c  | 16 ++++++++--------
 app/gimp-version.c |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/app/gimp-update.c b/app/gimp-update.c
index 2f823eb422..4ee1ce6127 100644
--- a/app/gimp-update.c
+++ b/app/gimp-update.c
@@ -89,7 +89,7 @@ gimp_check_updates_callback (GObject      *source,
   stream = g_file_read_finish (G_FILE (source), result, &error);
   if (stream)
     {
-      const gchar *build_platform;
+      const gchar *platform;
       const gchar *last_version   = NULL;
       const gchar *release_date   = NULL;
       JsonParser  *parser;
@@ -106,11 +106,11 @@ gimp_check_updates_callback (GObject      *source,
       /* For Windows and macOS, let's look if installers are available.
        * For other platforms, let's just look for source release.
        */
-      if (g_strcmp0 (GIMP_BUILD_PLATFORM, "windows") == 0 ||
-          g_strcmp0 (GIMP_BUILD_PLATFORM, "macos") == 0)
-        build_platform = GIMP_BUILD_PLATFORM;
+      if (g_strcmp0 (GIMP_BUILD_PLATFORM_FAMILY, "windows") == 0 ||
+          g_strcmp0 (GIMP_BUILD_PLATFORM_FAMILY, "macos") == 0)
+        platform = GIMP_BUILD_PLATFORM_FAMILY;
       else
-        build_platform = "source";
+        platform = "source";
 
       parser = json_parser_new ();
       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 ();
       /* Ideally we could just use Json path filters like this to
        * 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);
        * And that would be it! We'd have our last release for given
        * platform.
@@ -160,11 +160,11 @@ gimp_check_updates_callback (GObject      *source,
            * platform is available.
            */
           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");
               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;
             }
         }
diff --git a/app/gimp-version.c b/app/gimp-version.c
index d6c6699494..3d1894a036 100644
--- a/app/gimp-version.c
+++ b/app/gimp-version.c
@@ -229,7 +229,7 @@ gimp_version (gboolean be_verbose,
                                       GIMP_GIT_VERSION,
                                       GIMP_BUILD_ID,
                                       gimp_version_get_revision (),
-                                      GIMP_BUILD_PLATFORM,
+                                      GIMP_BUILD_PLATFORM_FAMILY,
                                       CC_VERSION,
                                       lib_versions);
       g_free (lib_versions);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]