extension-tool/create: Update for new versioning scheme

The "shell-version" field generated by the create command still
uses the old even/odd schema instead of the new "alpha", "beta"
etc. one.

Do that now, and also drop the different behavior for stable/unstable
releases (that is, always use only the major number, i.e. "40").

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3787

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1719>
This commit is contained in:
Florian Müllner 2021-02-26 00:54:50 +01:00
parent 95806c6a58
commit fe4fa1d2b0

View File

@ -49,11 +49,8 @@ get_shell_version (GError **error)
if (variant == NULL) if (variant == NULL)
return NULL; return NULL;
split_version = g_strsplit (g_variant_get_string (variant, NULL), ".", 3); split_version = g_strsplit (g_variant_get_string (variant, NULL), ".", 2);
if (g_ascii_strtoll (split_version[1], NULL, 10) % 2 == 0) return g_steal_pointer(&split_version[0]);
g_clear_pointer (&split_version[2], g_free);
return g_strjoinv (".", split_version);
} }
static GDesktopAppInfo * static GDesktopAppInfo *