diff options
Diffstat (limited to 'documentation/set_versions.py')
-rwxr-xr-x | documentation/set_versions.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/documentation/set_versions.py b/documentation/set_versions.py index 376337e7b5..5c55f470d7 100755 --- a/documentation/set_versions.py +++ b/documentation/set_versions.py | |||
@@ -99,12 +99,12 @@ docconfver = None | |||
99 | 99 | ||
100 | # Test tags exist and inform the user to fetch if not | 100 | # Test tags exist and inform the user to fetch if not |
101 | try: | 101 | try: |
102 | subprocess.run(["git", "show", "yocto-%s" % release_series[activereleases[0]]], capture_output=True, check=True) | 102 | subprocess.run(["git", "show", "yocto-%s" % release_series[activereleases[0]]], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True) |
103 | except subprocess.CalledProcessError: | 103 | except subprocess.CalledProcessError: |
104 | sys.exit("Please run 'git fetch --tags' before building the documentation") | 104 | sys.exit("Please run 'git fetch --tags' before building the documentation") |
105 | 105 | ||
106 | # Try and figure out what we are | 106 | # Try and figure out what we are |
107 | tags = subprocess.run(["git", "tag", "--points-at", "HEAD"], capture_output=True, text=True).stdout | 107 | tags = subprocess.run(["git", "tag", "--points-at", "HEAD"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True).stdout |
108 | for t in tags.split(): | 108 | for t in tags.split(): |
109 | if t.startswith("yocto-"): | 109 | if t.startswith("yocto-"): |
110 | ourversion = t[6:] | 110 | ourversion = t[6:] |
@@ -122,7 +122,7 @@ if ourversion: | |||
122 | bitbakeversion = bitbake_mapping[i] | 122 | bitbakeversion = bitbake_mapping[i] |
123 | else: | 123 | else: |
124 | # We're floating on a branch | 124 | # We're floating on a branch |
125 | branch = subprocess.run(["git", "branch", "--show-current"], capture_output=True, text=True).stdout.strip() | 125 | branch = subprocess.run(["git", "branch", "--show-current"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True).stdout.strip() |
126 | ourbranch = branch | 126 | ourbranch = branch |
127 | if branch != "master" and branch not in release_series: | 127 | if branch != "master" and branch not in release_series: |
128 | # We're not on a known release branch so we have to guess. Compare the numbers of commits | 128 | # We're not on a known release branch so we have to guess. Compare the numbers of commits |
@@ -130,7 +130,7 @@ else: | |||
130 | possible_branch = None | 130 | possible_branch = None |
131 | branch_count = 0 | 131 | branch_count = 0 |
132 | for b in itertools.chain(release_series.keys(), ["master"]): | 132 | for b in itertools.chain(release_series.keys(), ["master"]): |
133 | result = subprocess.run(["git", "log", "--format=oneline", "HEAD..origin/" + b], capture_output=True, text=True) | 133 | result = subprocess.run(["git", "log", "--format=oneline", "HEAD..origin/" + b], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True) |
134 | if result.returncode == 0: | 134 | if result.returncode == 0: |
135 | count = result.stdout.count('\n') | 135 | count = result.stdout.count('\n') |
136 | if not possible_branch or count < branch_count: | 136 | if not possible_branch or count < branch_count: |
@@ -153,9 +153,9 @@ else: | |||
153 | else: | 153 | else: |
154 | sys.exit("Unknown series for branch %s" % branch) | 154 | sys.exit("Unknown series for branch %s" % branch) |
155 | 155 | ||
156 | previoustags = subprocess.run(["git", "tag", "--merged", "HEAD"], capture_output=True, text=True).stdout | 156 | previoustags = subprocess.run(["git", "tag", "--merged", "HEAD"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True).stdout |
157 | previoustags = [t[6:] for t in previoustags.split() if t.startswith("yocto-" + release_series[ourseries])] | 157 | previoustags = [t[6:] for t in previoustags.split() if t.startswith("yocto-" + release_series[ourseries])] |
158 | futuretags = subprocess.run(["git", "tag", "--merged", ourbranch], capture_output=True, text=True).stdout | 158 | futuretags = subprocess.run(["git", "tag", "--merged", ourbranch], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True).stdout |
159 | futuretags = [t[6:] for t in futuretags.split() if t.startswith("yocto-" + release_series[ourseries])] | 159 | futuretags = [t[6:] for t in futuretags.split() if t.startswith("yocto-" + release_series[ourseries])] |
160 | 160 | ||
161 | # Append .999 against the last known version | 161 | # Append .999 against the last known version |
@@ -228,7 +228,7 @@ with open("sphinx-static/switchers.js.in", "r") as r, open("sphinx-static/switch | |||
228 | for branch in activereleases + ([ourseries] if ourseries not in activereleases else []): | 228 | for branch in activereleases + ([ourseries] if ourseries not in activereleases else []): |
229 | if branch == devbranch: | 229 | if branch == devbranch: |
230 | continue | 230 | continue |
231 | branch_versions = subprocess.run('git tag --list yocto-%s*' % (release_series[branch]), shell=True, capture_output=True, text=True).stdout.split() | 231 | branch_versions = subprocess.run('git tag --list yocto-%s*' % (release_series[branch]), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True).stdout.split() |
232 | branch_versions = sorted([v.replace("yocto-" + release_series[branch] + ".", "").replace("yocto-" + release_series[branch], "0") for v in branch_versions], key=int) | 232 | branch_versions = sorted([v.replace("yocto-" + release_series[branch] + ".", "").replace("yocto-" + release_series[branch], "0") for v in branch_versions], key=int) |
233 | if not branch_versions: | 233 | if not branch_versions: |
234 | continue | 234 | continue |
@@ -273,7 +273,7 @@ def tag_to_semver_like(v): | |||
273 | v_maj, v_min, v_patch = v_semver.groups('0') | 273 | v_maj, v_min, v_patch = v_semver.groups('0') |
274 | return int("{:0>2}{:0>2}{:0>2}".format(v_maj, v_min, v_patch), 10) | 274 | return int("{:0>2}{:0>2}{:0>2}".format(v_maj, v_min, v_patch), 10) |
275 | 275 | ||
276 | yocto_tags = subprocess.run(["git", "tag", "--list", "--sort=version:refname", "yocto-*"], capture_output=True, text=True).stdout | 276 | yocto_tags = subprocess.run(["git", "tag", "--list", "--sort=version:refname", "yocto-*"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True).stdout |
277 | yocto_tags = sorted(yocto_tags.split() + missing_tags, key=tag_to_semver_like) | 277 | yocto_tags = sorted(yocto_tags.split() + missing_tags, key=tag_to_semver_like) |
278 | tags = [tag[6:] for tag in yocto_tags] | 278 | tags = [tag[6:] for tag in yocto_tags] |
279 | 279 | ||