diff options
| author | Antonin Godard <antonin.godard@bootlin.com> | 2025-04-09 11:55:41 +0200 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2025-05-02 08:12:41 -0700 |
| commit | dc41858fe3622e8f5e088a7402ef89cd4a560236 (patch) | |
| tree | 70bc44f4634629919220413e2e475e481ca24532 /documentation | |
| parent | 8c784f928776cb0166e7bd1d6f25e9a7ea15e415 (diff) | |
| download | poky-dc41858fe3622e8f5e088a7402ef89cd4a560236.tar.gz | |
poky.yaml: introduce DISTRO_LATEST_TAG
Introduce the DISTRO_LATEST_TAG macro, which should always point to the
latest existing tag in the documentation, unlike DISTRO which may point
to A.B.999 to represent the tip of a branch.
This variable is needed to fix dead links in the documentation that
currently use the DISTRO macro.
Also, make DISTRO_REL_TAG use the DISTRO macro directly, to avoid
repetition, and add a DISTRO_REL_LATEST_TAG macro that has the same role
as DISTRO_LATEST_TAG but with "yocto-" prepended to it.
In set_versions.py, run the "git describe --abbrev=0 --tags
--match='yocto-*'" command to get the latest existing tag on the
currently checked out commit. Fallback to ourversion in case we didn't
find any.
(From yocto-docs rev: 9fabb08405601646fd9b00326442e03d43f68804)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
(cherry picked from commit a85b0e500c94921f77fa7b7dbb877e4945f96d1e)
Signed-off-by: Antonin Godard <antonin.godard@bootlin.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'documentation')
| -rw-r--r-- | documentation/poky.yaml.in | 11 | ||||
| -rwxr-xr-x | documentation/set_versions.py | 14 |
2 files changed, 23 insertions, 2 deletions
diff --git a/documentation/poky.yaml.in b/documentation/poky.yaml.in index 7a71007f93..de880af514 100644 --- a/documentation/poky.yaml.in +++ b/documentation/poky.yaml.in | |||
| @@ -2,13 +2,22 @@ | |||
| 2 | # Macros used in the documentation | 2 | # Macros used in the documentation |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | # The DISTRO variable represents the current docs version. It should be used | ||
| 6 | # when referring to the current docs version. See also DISTRO_LATEST_TAG. | ||
| 5 | DISTRO : "4.0" | 7 | DISTRO : "4.0" |
| 8 | # The DISTRO_LATEST_TAG represents the latest tag on the current branch. It | ||
| 9 | # should be used in HTTP link referring to the current docs version. In these | ||
| 10 | # cases, the DISTRO may point to A.B.999 which does not exist (just used to | ||
| 11 | # represent the latest HEAD revision on the branch). DISTRO_LATEST_TAG should | ||
| 12 | # always point to an existing tag. | ||
| 13 | DISTRO_LATEST_TAG : "4.0" | ||
| 6 | DISTRO_NAME_NO_CAP : "kirkstone" | 14 | DISTRO_NAME_NO_CAP : "kirkstone" |
| 7 | DISTRO_NAME : "Kirkstone" | 15 | DISTRO_NAME : "Kirkstone" |
| 8 | DISTRO_NAME_NO_CAP_MINUS_ONE : "honister" | 16 | DISTRO_NAME_NO_CAP_MINUS_ONE : "honister" |
| 9 | DISTRO_NAME_NO_CAP_LTS : "dunfell" | 17 | DISTRO_NAME_NO_CAP_LTS : "dunfell" |
| 10 | YOCTO_DOC_VERSION : "4.0" | 18 | YOCTO_DOC_VERSION : "4.0" |
| 11 | DISTRO_REL_TAG : "yocto-4.0" | 19 | DISTRO_REL_TAG : "yocto-$DISTRO;" |
| 20 | DISTRO_REL_LATEST_TAG : "yocto-&DISTRO_LATEST_TAG;" | ||
| 12 | DOCCONF_VERSION : "dev" | 21 | DOCCONF_VERSION : "dev" |
| 13 | BITBAKE_SERIES : "" | 22 | BITBAKE_SERIES : "" |
| 14 | YOCTO_DL_URL : "https://downloads.yoctoproject.org" | 23 | YOCTO_DL_URL : "https://downloads.yoctoproject.org" |
diff --git a/documentation/set_versions.py b/documentation/set_versions.py index 33d9da55ea..3ae7a07f4f 100755 --- a/documentation/set_versions.py +++ b/documentation/set_versions.py | |||
| @@ -152,17 +152,29 @@ series = [k for k in release_series] | |||
| 152 | previousseries = series[series.index(ourseries)+1:] or [""] | 152 | previousseries = series[series.index(ourseries)+1:] or [""] |
| 153 | lastlts = [k for k in previousseries if k in ltsseries] or "dunfell" | 153 | lastlts = [k for k in previousseries if k in ltsseries] or "dunfell" |
| 154 | 154 | ||
| 155 | latestreltag = subprocess.run(["git", "describe", "--abbrev=0", "--tags", "--match", "yocto-*"], capture_output=True, text=True).stdout | ||
| 156 | latestreltag = latestreltag.strip() | ||
| 157 | if latestreltag: | ||
| 158 | if latestreltag.startswith("yocto-"): | ||
| 159 | latesttag = latestreltag[6:] | ||
| 160 | else: | ||
| 161 | # fallback on the calculated version | ||
| 162 | print("Did not find a tag with 'git describe', falling back to %s" % ourversion) | ||
| 163 | latestreltag = "yocto-" + ourversion | ||
| 164 | latesttag = ourversion | ||
| 165 | |||
| 155 | print("Version calculated to be %s" % ourversion) | 166 | print("Version calculated to be %s" % ourversion) |
| 167 | print("Latest release tag found is %s" % latestreltag) | ||
| 156 | print("Release series calculated to be %s" % ourseries) | 168 | print("Release series calculated to be %s" % ourseries) |
| 157 | 169 | ||
| 158 | replacements = { | 170 | replacements = { |
| 159 | "DISTRO" : ourversion, | 171 | "DISTRO" : ourversion, |
| 172 | "DISTRO_LATEST_TAG": latesttag, | ||
| 160 | "DISTRO_NAME_NO_CAP" : ourseries, | 173 | "DISTRO_NAME_NO_CAP" : ourseries, |
| 161 | "DISTRO_NAME" : ourseries.capitalize(), | 174 | "DISTRO_NAME" : ourseries.capitalize(), |
| 162 | "DISTRO_NAME_NO_CAP_MINUS_ONE" : previousseries[0], | 175 | "DISTRO_NAME_NO_CAP_MINUS_ONE" : previousseries[0], |
| 163 | "DISTRO_NAME_NO_CAP_LTS" : lastlts[0], | 176 | "DISTRO_NAME_NO_CAP_LTS" : lastlts[0], |
| 164 | "YOCTO_DOC_VERSION" : ourversion, | 177 | "YOCTO_DOC_VERSION" : ourversion, |
| 165 | "DISTRO_REL_TAG" : "yocto-" + ourversion, | ||
| 166 | "DOCCONF_VERSION" : docconfver, | 178 | "DOCCONF_VERSION" : docconfver, |
| 167 | "BITBAKE_SERIES" : bitbakeversion, | 179 | "BITBAKE_SERIES" : bitbakeversion, |
| 168 | } | 180 | } |
