app, autotools: new GIMP_RELEASE macro.

We were using GIMP_UNSTABLE extensively to differentiate development
from stable code. But there is actually another level of development
code. Basically GIMP_UNSTABLE tells you are on the development branch,
e.g. for current branches, that you are on 2.99.* versions (vs. 2.10).
This depends on the minor version oddness.

GIMP_RELEASE will tell you if it's a release or a in-between-releases
code. This works with the micro version which must be even on release.
Any odd number means you are basically using random git code.

There can be any combination of GIMP_RELEASE and GIMP_UNSTABLE. For
instance 2.99.12 is a release of the unstable branch, whereas 2.10.33 is
development code of the stable branch.

I use this first in the update code as we were using GIMP_UNSTABLE for
both concepts but it made it harder to test. Now:

* GIMP_DEV_VERSIONS_JSON environment variable is only available on
  development code, not on release (whether stable or unstable).
* The weekly check limitation is also only for releases (dev code just
  check at every startup to quickly detect issues and regressions).
* Whether to look on testing website or public website json file depends
  on the code being a release or not.
* Finally only whether to check "DEVELOPMENT" or "STABLE" sections in
  the json file depends on whether we are on stable or unstable
  branches.

(cherry picked from commit fbb5b40345)
This commit is contained in:
Jehan
2022-09-05 21:59:26 +02:00
parent 7809cbf09d
commit e4a9f1b35a
2 changed files with 15 additions and 5 deletions

View File

@ -416,13 +416,13 @@ gimp_update_about_dialog (GimpCoreConfig *config,
static const gchar *
gimp_get_version_url ()
{
#ifdef GIMP_UNSTABLE
#ifdef GIMP_RELEASE
return "https://www.gimp.org/gimp_versions.json";
#else
if (g_getenv ("GIMP_DEV_VERSIONS_JSON"))
return g_getenv ("GIMP_DEV_VERSIONS_JSON");
else
return "https://testing.gimp.org/gimp_versions.json";
#else
return "https://www.gimp.org/gimp_versions.json";
#endif
}
@ -464,7 +464,7 @@ gimp_update_auto_check (GimpCoreConfig *config)
if (prev_update_timestamp > current_timestamp)
prev_update_timestamp = -1;
#ifndef GIMP_UNSTABLE
#ifdef GIMP_RELEASE
/* Do not check more than once a week. */
if (current_timestamp - prev_update_timestamp < 3600L * 24L * 7L)
return FALSE;