summaryrefslogtreecommitdiffstats
path: root/documentation/set_versions.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-18 14:16:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-23 12:08:56 +0000
commitb04eda74476fcaaee729ead79322694b3fb5937e (patch)
tree6cfcffee8331c0cfba6b6f76d91ae60443dd2cdf /documentation/set_versions.py
parent8d3e9aaede03f3615e5afb82df4d9b530a06a5f0 (diff)
downloadpoky-b04eda74476fcaaee729ead79322694b3fb5937e.tar.gz
conf.py/set_versions/poky.yaml: Set version in conf.py from poky.yaml
Allow conf.py to read the versions it needs from poky.yaml and have set_versions.py write this out. This means we don't have to change as many files when making new releases. (From yocto-docs rev: bfe74c67f327f0c6445cb4129ee0c32db022b95a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation/set_versions.py')
-rwxr-xr-xdocumentation/set_versions.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/documentation/set_versions.py b/documentation/set_versions.py
index d48b8b74c7..4ee28d0944 100755
--- a/documentation/set_versions.py
+++ b/documentation/set_versions.py
@@ -30,9 +30,20 @@ release_series["hardknott"] = "3.3"
30release_series["gatesgarth"] = "3.2" 30release_series["gatesgarth"] = "3.2"
31release_series["dunfell"] = "3.1" 31release_series["dunfell"] = "3.1"
32 32
33# "langdale" : "2.2",
34bitbake_mapping = {
35 "kirkstone" : "2.0",
36 "honister" : "1.52",
37 "hardknott" : "1.50",
38 "gatesgarth" : "1.48",
39 "dunfell" : "1.46",
40}
41
33ourversion = None 42ourversion = None
34ourseries = None 43ourseries = None
35ourbranch = None 44ourbranch = None
45bitbakeversion = None
46docconfver = None
36 47
37# Test tags exist and inform the user to fetch if not 48# Test tags exist and inform the user to fetch if not
38try: 49try:
@@ -50,10 +61,12 @@ if ourversion:
50 # We're a tagged release 61 # We're a tagged release
51 components = ourversion.split(".") 62 components = ourversion.split(".")
52 baseversion = components[0] + "." + components[1] 63 baseversion = components[0] + "." + components[1]
64 docconfver = ourversion
53 for i in release_series: 65 for i in release_series:
54 if release_series[i] == baseversion: 66 if release_series[i] == baseversion:
55 ourseries = i 67 ourseries = i
56 ourbranch = i 68 ourbranch = i
69 bitbakeversion = bitbake_mapping[i]
57else: 70else:
58 # We're floating on a branch 71 # We're floating on a branch
59 branch = subprocess.run(["git", "branch", "--show-current"], capture_output=True, text=True).stdout.strip() 72 branch = subprocess.run(["git", "branch", "--show-current"], capture_output=True, text=True).stdout.strip()
@@ -73,8 +86,11 @@ else:
73 print("Nearest release branch esimtated to be %s" % branch) 86 print("Nearest release branch esimtated to be %s" % branch)
74 if branch == "master": 87 if branch == "master":
75 ourseries = devbranch 88 ourseries = devbranch
89 docconfver = "dev"
90 bitbakeversion = ""
76 elif branch in release_series: 91 elif branch in release_series:
77 ourseries = branch 92 ourseries = branch
93 bitbakeversion = bitbake_mapping[branch]
78 else: 94 else:
79 sys.exit("Unknown series for branch %s" % branch) 95 sys.exit("Unknown series for branch %s" % branch)
80 96
@@ -88,6 +104,8 @@ else:
88 ourversion = previoustags[-1] + ".999" 104 ourversion = previoustags[-1] + ".999"
89 else: 105 else:
90 ourversion = release_series[ourseries] + ".999" 106 ourversion = release_series[ourseries] + ".999"
107 if not docconfver:
108 docconfver = ourversion
91 109
92series = [k for k in release_series] 110series = [k for k in release_series]
93previousseries = series[series.index(ourseries)+1:] 111previousseries = series[series.index(ourseries)+1:]
@@ -104,6 +122,8 @@ replacements = {
104 "DISTRO_NAME_NO_CAP_LTS" : lastlts[0], 122 "DISTRO_NAME_NO_CAP_LTS" : lastlts[0],
105 "YOCTO_DOC_VERSION" : ourversion, 123 "YOCTO_DOC_VERSION" : ourversion,
106 "DISTRO_REL_TAG" : "yocto-" + ourversion, 124 "DISTRO_REL_TAG" : "yocto-" + ourversion,
125 "DOCCONF_VERSION" : docconfver,
126 "BITBAKE_SERIES" : bitbakeversion,
107} 127}
108 128
109with open("poky.yaml.in", "r") as r, open("poky.yaml", "w") as w: 129with open("poky.yaml.in", "r") as r, open("poky.yaml", "w") as w: