[glib: 1/2] meson: Use range() instead of listing all stable versions




commit 5942103937aea148d5b57f8412c54870aa7bdc90
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Wed May 11 14:34:00 2022 -0400

    meson: Use range() instead of listing all stable versions
    
    Note that range(), like in python, has start value included and stop
    value excluded. That's why we use last_version + 2.

 docs/reference/meson.build | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 564e1ca2a7..ad1b9e3536 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -1,14 +1,8 @@
 # The list of minor versions in the 2.x.x series which have had
 # GLIB_AVAILABLE_IN_* macros. This should include the current unreleased stable
 # version.
-#
-# FIXME: It would be good to be able to generate this list:
-# https://github.com/mesonbuild/meson/issues/5026
-stable_2_series_versions = [
-  '26', '28', '30', '32', '34', '36', '38',
-  '40', '42', '44', '46', '48', '50', '52', '54', '56', '58',
-  '60', '62', '64', '66', '68', '70', '72', '74',
-]
+first_version = 26
+last_version = minor_version.is_odd() ? minor_version + 1 : minor_version
 
 ignore_decorators = [
   'GLIB_VAR',
@@ -17,7 +11,8 @@ ignore_decorators = [
   'GLIB_AVAILABLE_IN_ALL',
 ]
 
-foreach version : stable_2_series_versions
+foreach i : range(first_version, last_version + 2, 2)
+  version = i.to_string()
   ignore_decorators += [
     # Note that gtkdoc is going to use those in regex, and the longest match
     # must come first. That's why '_FOR()' variant comes first.


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