Merge ~fourdollars/pc-enablement/+git/oem-scripts:master into ~oem-solutions-engineers/pc-enablement/+git/oem-scripts:master
- Git
- lp:~fourdollars/pc-enablement/+git/oem-scripts
- master
- Merge into master
Status: | Merged |
---|---|
Approved by: | Shih-Yuan Lee |
Approved revision: | 745429770c0a14a979dfebc9c41a4f46d0c170ab |
Merged at revision: | ae352169ae3adfa9839d20ca24375f8b2cf27c80 |
Proposed branch: | ~fourdollars/pc-enablement/+git/oem-scripts:master |
Merge into: | ~oem-solutions-engineers/pc-enablement/+git/oem-scripts:master |
Diff against target: |
572 lines (+193/-86) 3 files modified
debian/tests/mir-bug (+27/-2) mir-bug (+165/-83) oem-meta-package.mir.jinja2 (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Bin Li | Approve | ||
Review via email: mp+433421@code.launchpad.net |
Commit message
Description of the change
OEM Taipei Bot (oem-taipei-bot) wrote : | # |
OEM Taipei Bot (oem-taipei-bot) wrote : | # |
[autopkgtest]
autopkgtest-
autopkgtest-
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
pkg-list PASS
review-
run-autopkgtest PASS
setup-apt-dir PASS
bootstrap-meta PASS
mir-bug FAIL non-zero exit status 1
oem-meta-packages PASS
git-url-
lp-dl-attm PASS
recovery-
OEM Taipei Bot (oem-taipei-bot) wrote : | # |
[autopkgtest]
autopkgtest-
autopkgtest-
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
pkg-list PASS
review-
run-autopkgtest PASS
setup-apt-dir PASS
bootstrap-meta PASS
mir-bug FAIL non-zero exit status 1
oem-meta-packages PASS
git-url-
lp-dl-attm PASS
recovery-
Shih-Yuan Lee (fourdollars) wrote : | # |
mir-bug FAIL non-zero exit status 1
Traceback (most recent call last):
File "/usr/bin/mir-bug", line 1259, in <module>
update_bug(
File "/usr/bin/mir-bug", line 432, in update_bug
check_
TypeError: check_and_
OEM Taipei Bot (oem-taipei-bot) wrote : | # |
[autopkgtest]
autopkgtest-
autopkgtest-
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
pkg-list PASS
review-
run-autopkgtest PASS
setup-apt-dir PASS
bootstrap-meta PASS
mir-bug FAIL non-zero exit status 1
oem-meta-packages PASS
git-url-
lp-dl-attm PASS
recovery-
OEM Taipei Bot (oem-taipei-bot) wrote : | # |
[autopkgtest]
autopkgtest-
autopkgtest-
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
pkg-list PASS
review-
run-autopkgtest PASS
setup-apt-dir PASS
bootstrap-meta PASS
mir-bug FAIL non-zero exit status 1
oem-meta-packages PASS
git-url-
lp-dl-attm PASS
recovery-
OEM Taipei Bot (oem-taipei-bot) wrote : | # |
[autopkgtest]
autopkgtest-
autopkgtest-
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bug-bind PASS
get-private-ppa PASS
jq-lp PASS
launchpad-api PASS
lp-bug PASS
pkg-list PASS
review-
run-autopkgtest PASS
setup-apt-dir PASS
bootstrap-meta PASS
mir-bug PASS
oem-meta-packages PASS
git-url-
lp-dl-attm PASS
recovery-
Bin Li (binli) wrote : | # |
LGTM.
BTW, I wish we could parse the json file name/content to get the series when use 'mir update', :)
Preview Diff
1 | diff --git a/debian/tests/mir-bug b/debian/tests/mir-bug |
2 | index 216eb7b..04c8b9d 100644 |
3 | --- a/debian/tests/mir-bug |
4 | +++ b/debian/tests/mir-bug |
5 | @@ -23,12 +23,24 @@ cat > "$AUTOPKGTEST_ARTIFACTS"/fossa-tentacool.json <<ENDLINE |
6 | "mirbug": 1943413, |
7 | "productnames": [ |
8 | "XPS 9320" |
9 | - ] |
10 | + ], |
11 | + "series": "focal" |
12 | } |
13 | ENDLINE |
14 | |
15 | export COPYRIGHT_YEAR=2022 |
16 | |
17 | +cleanup() { |
18 | + echo "= cleanup =" |
19 | + if [ -f "bugid" ]; then |
20 | + BUG_ID=$(cat bugid) |
21 | + rm bugid |
22 | + lp-bug cleanup --yes "$BUG_ID" |
23 | + fi |
24 | +} |
25 | + |
26 | +trap cleanup EXIT INT TERM |
27 | + |
28 | # check/update |
29 | mir-bug update --yes --skip --ready --release "$AUTOPKGTEST_ARTIFACTS"/fossa-tentacool.json |
30 | mir-bug check --skip --ready --release "$AUTOPKGTEST_ARTIFACTS"/fossa-tentacool.json |
31 | @@ -36,8 +48,21 @@ mir-bug update --yes --skip --tz=UTC --release "$AUTOPKGTEST_ARTIFACTS"/fossa-te |
32 | mir-bug check --skip --tz=UTC --release "$AUTOPKGTEST_ARTIFACTS"/fossa-tentacool.json |
33 | |
34 | # create |
35 | -mir-bug create -o bug_id somerville bronn "some Dell platforms" |
36 | +mir-bug create -o bug_id somerville bronn "some Dell platforms" --series focal |
37 | +BUG_ID=$(cat bug_id) |
38 | +launchpad-api get bugs/"$BUG_ID" > "$AUTOPKGTEST_ARTIFACTS/$BUG_ID.json" |
39 | +jq -r .title < "$AUTOPKGTEST_ARTIFACTS/$BUG_ID.json" | grep "\[MIR\] oem-somerville-bronn-meta" |
40 | +jq -r .description < "$AUTOPKGTEST_ARTIFACTS/$BUG_ID.json" | grep focal |
41 | +jq -r .description < "$AUTOPKGTEST_ARTIFACTS/$BUG_ID.json" | grep 20.04 |
42 | +lp-bug cleanup --yes "$BUG_ID" |
43 | +rm bug_id |
44 | + |
45 | +mir-bug create -o bug_id somerville bronn "some Dell platforms" --series jammy |
46 | BUG_ID=$(cat bug_id) |
47 | +launchpad-api get bugs/"$BUG_ID" > "$AUTOPKGTEST_ARTIFACTS/$BUG_ID.json" |
48 | +jq -r .title < "$AUTOPKGTEST_ARTIFACTS/$BUG_ID.json" | grep "\[MIR\]\[jammy\] oem-somerville-bronn-meta" |
49 | +jq -r .description < "$AUTOPKGTEST_ARTIFACTS/$BUG_ID.json" | grep jammy |
50 | +jq -r .description < "$AUTOPKGTEST_ARTIFACTS/$BUG_ID.json" | grep 22.04 |
51 | lp-bug cleanup --yes "$BUG_ID" |
52 | rm bug_id |
53 | |
54 | diff --git a/mir-bug b/mir-bug |
55 | index cb8e828..e752ce3 100755 |
56 | --- a/mir-bug |
57 | +++ b/mir-bug |
58 | @@ -24,6 +24,7 @@ import difflib |
59 | import jinja2 |
60 | import json |
61 | import lazr |
62 | +import lsb_release |
63 | import oem_scripts |
64 | import os |
65 | import re |
66 | @@ -32,6 +33,7 @@ import shutil |
67 | import sys |
68 | |
69 | from copy import copy |
70 | +from distro_info import UbuntuDistroInfo |
71 | from glob import glob |
72 | from logging import debug, info, warning, error, critical |
73 | from oem_scripts import ( |
74 | @@ -71,6 +73,11 @@ create.add_argument("oemCodename", help="Such as somerville, stella, or sutton.s |
75 | create.add_argument("platformCodename", help="Name deined by PM, like ace.") |
76 | create.add_argument("deviceName", help="ThinkPad X1 Carbon Gen 8") |
77 | create.add_argument( |
78 | + "-s", |
79 | + "--series", |
80 | + help="Specify the Ubuntu series to create the bug.", |
81 | +) |
82 | +create.add_argument( |
83 | "-o", |
84 | "--output", |
85 | help="Specify a file name to write the bug number.", |
86 | @@ -148,6 +155,7 @@ args = parser.parse_args() |
87 | setup_logging(debug=args.debug, quiet=args.quiet) |
88 | |
89 | pattern = re.compile(r".*\[MIR\]\W*oem-([^-]*)-(.*)-meta\W*") |
90 | +pattern2 = re.compile(r".*\[MIR\]\[(.*)\]\W*oem-([^-]*)-(.*)-meta\W*") |
91 | |
92 | |
93 | def _grouping_market_names(market_names: list, maxsplit=1) -> str: |
94 | @@ -177,7 +185,7 @@ def _grouping_market_names(market_names: list, maxsplit=1) -> str: |
95 | return ", ".join(f"{name} {'/'.join(models)}" for name, models in tmp.items()) |
96 | |
97 | |
98 | -def create_bug(lp, oemCodename, platformCodename, deviceName): |
99 | +def create_bug(lp, oemCodename, platformCodename, deviceName, series): |
100 | info("Creating bug...") |
101 | tempList = oemCodename.split(".") |
102 | oemCodenameNogroup = tempList[0] |
103 | @@ -192,18 +200,22 @@ def create_bug(lp, oemCodename, platformCodename, deviceName): |
104 | metaPkgName = "oem-" + oemCodename + "-" + platformCodename + "-meta" |
105 | |
106 | if oemGroupName.strip() != "": |
107 | - branchName = oemGroupName + "." + platformCodename + "-focal-ubuntu" |
108 | + branchName = oemGroupName + "." + platformCodename + f"-{series}-ubuntu" |
109 | else: |
110 | - branchName = platformCodename + "-focal-ubuntu" |
111 | + branchName = platformCodename + f"-{series}-ubuntu" |
112 | |
113 | project = lp.projects["oem-priority"] |
114 | |
115 | - bt = "[DRAFT][MIR] " + metaPkgName |
116 | + if series == "focal": |
117 | + bt = f"[DRAFT][MIR] {metaPkgName}" |
118 | + else: |
119 | + bt = f"[DRAFT][MIR][{series}] {metaPkgName}" |
120 | bd = "[DRAFT]" + read_from_template( |
121 | metaPkgName=metaPkgName, |
122 | branchName=branchName, |
123 | oemCodenameNogroup=oemCodenameNogroup, |
124 | deviceName=deviceName, |
125 | + series=series, |
126 | ) |
127 | bug = lp.bugs.createBug( |
128 | description=bd, |
129 | @@ -281,19 +293,26 @@ def collect_bugs(lp, output): |
130 | ) |
131 | continue |
132 | |
133 | - result = pattern.match(bug.title) |
134 | + result = pattern2.match(bug.title) |
135 | git = None |
136 | if result: |
137 | - if "." in result.group(1): |
138 | - project, group = result.group(1).split(".") |
139 | - else: |
140 | - project = result.group(1) |
141 | - group = None |
142 | - platform = result.group(2) |
143 | - if group: |
144 | - git = f"git clone --depth 1 -b {group}.{platform}-focal-ubuntu https://git.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-{project}-projects-meta oem-{project}.{group}-{platform}-meta" |
145 | - else: |
146 | - git = f"git clone --depth 1 -b {platform}-focal-ubuntu https://git.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-{project}-projects-meta oem-{project}-{platform}-meta" |
147 | + series = result.group(1) |
148 | + project = result.group(2) |
149 | + platform = result.group(3) |
150 | + git = f"git clone --depth 1 -b {platform}-{series}-ubuntu https://git.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-{project}-projects-meta oem-{project}-{platform}-meta" |
151 | + else: |
152 | + result = pattern.match(bug.title) |
153 | + if result: |
154 | + if "." in result.group(1): |
155 | + project, group = result.group(1).split(".") |
156 | + else: |
157 | + project = result.group(1) |
158 | + group = None |
159 | + platform = result.group(2) |
160 | + if group: |
161 | + git = f"git clone --depth 1 -b {group}.{platform}-focal-ubuntu https://git.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-{project}-projects-meta oem-{project}.{group}-{platform}-meta" |
162 | + else: |
163 | + git = f"git clone --depth 1 -b {platform}-focal-ubuntu https://git.launchpad.net/~oem-solutions-engineers/pc-enablement/+git/oem-{project}-projects-meta oem-{project}-{platform}-meta" |
164 | |
165 | subscriptions = [] |
166 | for subscription in bug.subscriptions: |
167 | @@ -338,6 +357,7 @@ def collect_bugs(lp, output): |
168 | |
169 | def update_bug( |
170 | lp, |
171 | + series: str, |
172 | bug_number: int, |
173 | yes: bool, |
174 | certified: bool = False, |
175 | @@ -353,7 +373,7 @@ def update_bug( |
176 | bug_modified = True |
177 | bug.description = desc |
178 | |
179 | - if check_bug_title(bug, pkg_name) is False and yes_or_ask( |
180 | + if check_bug_title(bug, pkg_name, series) is False and yes_or_ask( |
181 | yes, "Do you want to update the bug title?" |
182 | ): |
183 | bug_modified = True |
184 | @@ -406,9 +426,11 @@ def update_bug( |
185 | if tags != bug.tags: |
186 | bug.tags = tags |
187 | |
188 | - check_and_update_git_repo(bug, pkg_name, yes=yes, update=True, username=lp.me.name) |
189 | + check_and_update_git_repo( |
190 | + bug, pkg_name, series=series, yes=yes, update=True, username=lp.me.name |
191 | + ) |
192 | |
193 | - check_and_update_bug_attachments(bug, pkg_name, update=True, yes=yes) |
194 | + check_and_update_bug_attachments(bug, pkg_name, series=series, update=True, yes=yes) |
195 | |
196 | if bug_modified: |
197 | bug.lp_save() |
198 | @@ -420,7 +442,11 @@ def update_bug( |
199 | |
200 | |
201 | def check_bug( |
202 | - lp, bug_number: int, certified: bool = False, certified_hardwares: list = [] |
203 | + lp, |
204 | + bug_number: int, |
205 | + series: str, |
206 | + certified: bool = False, |
207 | + certified_hardwares: list = [], |
208 | ) -> None: |
209 | bug = lp.bugs[bug_number] |
210 | info(f'Checking LP: #{bug_number} - "{bug.title}" ...') |
211 | @@ -428,7 +454,7 @@ def check_bug( |
212 | desc, pkg_name = check_bug_description(bug, certified_hardwares) |
213 | if desc: |
214 | need_fixing = True |
215 | - if check_bug_title(bug, pkg_name) is False: |
216 | + if check_bug_title(bug, pkg_name, series) is False: |
217 | need_fixing = True |
218 | if check_bug_importance(bug) is False: |
219 | need_fixing = True |
220 | @@ -438,13 +464,14 @@ def check_bug( |
221 | need_fixing = True |
222 | if check_bug_tags(bug, certified) is False: |
223 | need_fixing = True |
224 | - if check_and_update_git_repo(bug, pkg_name) is False: |
225 | + if check_and_update_git_repo(bug, pkg_name, series=series) is False: |
226 | need_fixing = True |
227 | - if check_and_update_bug_attachments(bug, pkg_name) is False: |
228 | + if check_and_update_bug_attachments(bug, pkg_name, series=series) is False: |
229 | need_fixing = True |
230 | if ( |
231 | not args.skip |
232 | - and check_and_update_git_repo(bug, pkg_name, bootstrap=False) is False |
233 | + and check_and_update_git_repo(bug, pkg_name, series=series, bootstrap=False) |
234 | + is False |
235 | ): |
236 | need_fixing = True |
237 | |
238 | @@ -456,22 +483,31 @@ def check_bug( |
239 | |
240 | def check_bug_description(bug, certified_hardwares: list) -> (str, str): |
241 | info("Checking bug description...") |
242 | - result = pattern.match(bug.title) |
243 | + result = pattern2.match(bug.title) |
244 | if not result: |
245 | - critical(f"LP: #{bug.id} '{bug.title}' is NOT MATCHED") |
246 | - exit(1) |
247 | - |
248 | - if "." in result.group(1): |
249 | - project, group = result.group(1).split(".") |
250 | - platform = result.group(2) |
251 | - branchName = group + "." + platform + "-focal-ubuntu" |
252 | + result = pattern.match(bug.title) |
253 | + if not result: |
254 | + critical(f"LP: #{bug.id} '{bug.title}' is NOT MATCHED") |
255 | + exit(1) |
256 | + if "." in result.group(1): |
257 | + project, group = result.group(1).split(".") |
258 | + platform = result.group(2) |
259 | + branchName = group + "." + platform + "-focal-ubuntu" |
260 | + else: |
261 | + project = result.group(1) |
262 | + platform = result.group(2) |
263 | + group = None |
264 | + branchName = platform + "-focal-ubuntu" |
265 | + metaPkgName = f"oem-{result.group(1)}-{result.group(2)}-meta" |
266 | + series = "focal" |
267 | else: |
268 | - project = result.group(1) |
269 | - platform = result.group(2) |
270 | + series = result.group(1) |
271 | + project = result.group(2) |
272 | + platform = result.group(3) |
273 | group = None |
274 | - branchName = platform + "-focal-ubuntu" |
275 | + branchName = platform + f"-{series}-ubuntu" |
276 | + metaPkgName = f"oem-{project}-{platform}-meta" |
277 | |
278 | - metaPkgName = f"oem-{result.group(1)}-{result.group(2)}-meta" |
279 | prog = re.compile(r"\W*We want to improve the hardware support for ([^.]*).\W*") |
280 | deviceName = None |
281 | |
282 | @@ -480,7 +516,7 @@ def check_bug_description(bug, certified_hardwares: list) -> (str, str): |
283 | if not result: |
284 | continue |
285 | deviceName = result.group(1) |
286 | - if deviceName.endswith(" on focal"): |
287 | + if deviceName.endswith(f" on {series}"): |
288 | deviceName = deviceName[:-9] |
289 | break |
290 | else: |
291 | @@ -492,6 +528,7 @@ def check_bug_description(bug, certified_hardwares: list) -> (str, str): |
292 | branchName=branchName, |
293 | oemCodenameNogroup=project, |
294 | deviceName=deviceName, |
295 | + series=series, |
296 | ) |
297 | |
298 | if certified_hardwares: |
299 | @@ -517,9 +554,11 @@ def check_bug_description(bug, certified_hardwares: list) -> (str, str): |
300 | return (None, metaPkgName) |
301 | |
302 | |
303 | -def check_bug_title(bug, pkg_name: str) -> bool: |
304 | +def check_bug_title(bug, pkg_name: str, series: str) -> bool: |
305 | info("Checking bug title...") |
306 | - if bug.title == f"[MIR] {pkg_name}": |
307 | + if series == "focal" and bug.title == f"[MIR] {pkg_name}": |
308 | + return True |
309 | + elif bug.title == f"[MIR][{series}] {pkg_name}": |
310 | return True |
311 | error(f"The bug title shall be '[MIR] {pkg_name}' but it is '{bug.title}'.") |
312 | return False |
313 | @@ -733,29 +772,43 @@ def check_bug_tags(bug, certified: bool = False) -> bool: |
314 | |
315 | |
316 | def check_and_update_bug_attachments( |
317 | - bug, pkg_name: str, update=False, yes=False |
318 | + bug, |
319 | + pkg_name: str, |
320 | + series: str, |
321 | + update=False, |
322 | + yes=False, |
323 | ) -> bool: |
324 | if update: |
325 | info("Checking and updating attachments...") |
326 | else: |
327 | info("Checking attachments...") |
328 | - result = pattern.match(f"[MIR] {pkg_name}") |
329 | |
330 | - if result is None: |
331 | - critical(f"{pkg_name} failed.") |
332 | - exit(1) |
333 | - |
334 | - if "." in result.group(1): |
335 | - project, group = result.group(1).split(".") |
336 | + if series != "focal": |
337 | + result = pattern2.match(f"[MIR][{series}] {pkg_name}") |
338 | + if result is None: |
339 | + critical(f"{pkg_name} failed.") |
340 | + exit(1) |
341 | + project = result.group(2) |
342 | + platform = result.group(3) |
343 | + branch = f"{platform}-{series}-ubuntu" |
344 | else: |
345 | - project = result.group(1) |
346 | - group = None |
347 | - platform = result.group(2) |
348 | + result = pattern.match(f"[MIR] {pkg_name}") |
349 | |
350 | - if group: |
351 | - branch = f"{group}.{platform}-focal-ubuntu" |
352 | - else: |
353 | - branch = f"{platform}-focal-ubuntu" |
354 | + if result is None: |
355 | + critical(f"{pkg_name} failed.") |
356 | + exit(1) |
357 | + |
358 | + if "." in result.group(1): |
359 | + project, group = result.group(1).split(".") |
360 | + else: |
361 | + project = result.group(1) |
362 | + group = None |
363 | + platform = result.group(2) |
364 | + |
365 | + if group: |
366 | + branch = f"{group}.{platform}-focal-ubuntu" |
367 | + else: |
368 | + branch = f"{platform}-focal-ubuntu" |
369 | |
370 | git_command = ( |
371 | "git", |
372 | @@ -855,7 +908,13 @@ def check_and_update_bug_attachments( |
373 | |
374 | |
375 | def check_and_update_git_repo( |
376 | - bug, pkg_name: str, yes=False, bootstrap=True, update=False, username=None |
377 | + bug, |
378 | + pkg_name: str, |
379 | + series: str, |
380 | + yes=False, |
381 | + bootstrap=True, |
382 | + update=False, |
383 | + username=None, |
384 | ) -> bool: |
385 | if update: |
386 | if bootstrap: |
387 | @@ -868,28 +927,37 @@ def check_and_update_git_repo( |
388 | else: |
389 | info("Checking git repo for oem branch...") |
390 | |
391 | - result = pattern.match(f"[MIR] {pkg_name}") |
392 | + if series != "focal": |
393 | + result = pattern2.match(f"[MIR][{series}] {pkg_name}") |
394 | + platform = result.group(2) |
395 | + if bootstrap: |
396 | + suffix = "ubuntu" |
397 | + else: |
398 | + suffix = "oem" |
399 | + branch = f"{platform}-{series}-{suffix}" |
400 | + else: |
401 | + result = pattern.match(f"[MIR] {pkg_name}") |
402 | |
403 | - if result is None: |
404 | - critical(f"{pkg_name} failed.") |
405 | - exit(1) |
406 | + if result is None: |
407 | + critical(f"{pkg_name} failed.") |
408 | + exit(1) |
409 | |
410 | - if "." in result.group(1): |
411 | - project, group = result.group(1).split(".") |
412 | - else: |
413 | - project = result.group(1) |
414 | - group = None |
415 | - platform = result.group(2) |
416 | + if "." in result.group(1): |
417 | + project, group = result.group(1).split(".") |
418 | + else: |
419 | + project = result.group(1) |
420 | + group = None |
421 | + platform = result.group(2) |
422 | |
423 | - if bootstrap: |
424 | - suffix = "ubuntu" |
425 | - else: |
426 | - suffix = "oem" |
427 | + if bootstrap: |
428 | + suffix = "ubuntu" |
429 | + else: |
430 | + suffix = "oem" |
431 | |
432 | - if group: |
433 | - branch = f"{group}.{platform}-focal-{suffix}" |
434 | - else: |
435 | - branch = f"{platform}-focal-{suffix}" |
436 | + if group: |
437 | + branch = f"{group}.{platform}-focal-{suffix}" |
438 | + else: |
439 | + branch = f"{platform}-focal-{suffix}" |
440 | |
441 | kernel_flavour, kernel_meta, market_name, ids = _get_items_from_git( |
442 | project, branch, pkg_name |
443 | @@ -940,10 +1008,11 @@ def check_and_update_git_repo( |
444 | ): |
445 | market_name = new_market_name |
446 | |
447 | + version = UbuntuDistroInfo().version(series).split(" ")[0] |
448 | if kernel_flavour == "default": |
449 | if kernel_meta is None: |
450 | - kernel_meta = "linux-generic-hwe-20.04" |
451 | - elif kernel_meta == "linux-generic-hwe-20.04": |
452 | + kernel_meta = f"linux-generic-hwe-{version}" |
453 | + elif kernel_meta == f"linux-generic-hwe-{version}": |
454 | pass |
455 | else: |
456 | critical( |
457 | @@ -952,8 +1021,8 @@ def check_and_update_git_repo( |
458 | exit(1) |
459 | elif kernel_flavour == "oem": |
460 | if kernel_meta is None: |
461 | - kernel_meta = "linux-oem-20.04" |
462 | - elif kernel_meta.startswith("linux-oem-20.04"): |
463 | + kernel_meta = f"linux-oem-{version}" |
464 | + elif kernel_meta.startswith(f"linux-oem-{version}"): |
465 | pass |
466 | else: |
467 | critical( |
468 | @@ -972,7 +1041,7 @@ def check_and_update_git_repo( |
469 | command = [ |
470 | "pkg-somerville-meta", |
471 | "-s", |
472 | - "focal", |
473 | + series, |
474 | "-k", |
475 | kernel_meta, |
476 | "-p", |
477 | @@ -991,7 +1060,7 @@ def check_and_update_git_repo( |
478 | command = [ |
479 | "pkg-stella-meta", |
480 | "-s", |
481 | - "focal", |
482 | + series, |
483 | "-k", |
484 | kernel_meta, |
485 | "-g", |
486 | @@ -1012,7 +1081,7 @@ def check_and_update_git_repo( |
487 | command = [ |
488 | "pkg-sutton-meta", |
489 | "-s", |
490 | - "focal", |
491 | + series, |
492 | "-k", |
493 | kernel_meta, |
494 | "-g", |
495 | @@ -1060,10 +1129,13 @@ def check_and_update_git_repo( |
496 | with open(changelog, "r") as f: |
497 | lines = f.readlines() |
498 | |
499 | + version = UbuntuDistroInfo().version(series).split(" ")[0] |
500 | if args.release: |
501 | - lines[0] = f"{pkg_name} (20.04~ubuntu1) focal; urgency=medium\n" |
502 | + lines[0] = f"{pkg_name} ({version}~ubuntu1) {series}; urgency=medium\n" |
503 | else: |
504 | - lines[0] = f"{pkg_name} (20.04~ubuntu1) UNRELEASED; urgency=medium\n" |
505 | + lines[ |
506 | + 0 |
507 | + ] = f"{pkg_name} ({version}~ubuntu1) UNRELEASED; urgency=medium\n" |
508 | |
509 | if f"(LP: #{bug.id})" not in lines[2] and lines[2].startswith( |
510 | " * Meta package for" |
511 | @@ -1130,7 +1202,8 @@ def check_and_update_git_repo( |
512 | return True |
513 | |
514 | |
515 | -def read_from_template(metaPkgName, branchName, oemCodenameNogroup, deviceName): |
516 | +def read_from_template(metaPkgName, branchName, oemCodenameNogroup, deviceName, series): |
517 | + version = UbuntuDistroInfo().version(series).split(" ")[0] |
518 | env = jinja2.Environment( |
519 | loader=jinja2.FileSystemLoader(["./", "/usr/share/oem-scripts"]) |
520 | ) |
521 | @@ -1140,6 +1213,7 @@ def read_from_template(metaPkgName, branchName, oemCodenameNogroup, deviceName): |
522 | branchName=branchName, |
523 | oemCodenameNogroup=oemCodenameNogroup, |
524 | deviceName=deviceName, |
525 | + version=version, |
526 | ) |
527 | |
528 | |
529 | @@ -1148,7 +1222,13 @@ if args.subcommand: |
530 | lp = login.lp |
531 | |
532 | if args.subcommand == "create": |
533 | - create_bug(lp, args.oemCodename, args.platformCodename, args.deviceName) |
534 | + if not args.series: |
535 | + series = lsb_release.get_os_release()["CODENAME"] |
536 | + else: |
537 | + series = args.series |
538 | + if not UbuntuDistroInfo().is_lts(series): |
539 | + series = UbuntuDistroInfo().lts() |
540 | + create_bug(lp, args.oemCodename, args.platformCodename, args.deviceName, series) |
541 | elif args.subcommand == "update": |
542 | args.json = json.load(args.json) |
543 | certified = False |
544 | @@ -1182,6 +1262,7 @@ elif args.subcommand == "update": |
545 | |
546 | update_bug( |
547 | lp, |
548 | + series=args.json["series"], |
549 | bug_number=bug_number, |
550 | yes=args.yes, |
551 | certified=certified, |
552 | @@ -1220,6 +1301,7 @@ elif args.subcommand == "check": |
553 | |
554 | check_bug( |
555 | lp, |
556 | + series=args.json["series"], |
557 | bug_number=bug_number, |
558 | certified=certified, |
559 | certified_hardwares=certified_hardwares, |
560 | diff --git a/oem-meta-package.mir.jinja2 b/oem-meta-package.mir.jinja2 |
561 | index 064ec6a..6c44b08 100644 |
562 | --- a/oem-meta-package.mir.jinja2 |
563 | +++ b/oem-meta-package.mir.jinja2 |
564 | @@ -32,7 +32,7 @@ No CVE/known security issue. |
565 | |
566 | [Quality assurance] |
567 | I have used ppa:oem-solutions-engineers/oem-projects-meta to check this package on {{ deviceName }}. |
568 | -{{ metaPkgName }} will be upgraded to 20.04ubuntu1 or the later version from OEM archive. |
569 | +{{ metaPkgName }} will be upgraded to {{ version }}ubuntu1 or the later version from OEM archive. |
570 | |
571 | [Dependencies] |
572 | It only depends on ubuntu-oem-keyring. |
[autopkgtest] collect- credentials PASS oem-scripts- auto PASS merge-proposal PASS insteadof- setting PASS from-iso. sh PASS
autopkgtest-
autopkgtest-
pkg-somerville-meta PASS
pkg-stella-meta PASS
pkg-sutton-meta PASS
bug-bind PASS
get-private-ppa FAIL non-zero exit status 1
jq-lp PASS
launchpad-api PASS
lp-bug PASS
pkg-list PASS
review-
run-autopkgtest PASS
setup-apt-dir PASS
bootstrap-meta PASS
mir-bug PASS
oem-meta-packages PASS
git-url-
lp-dl-attm PASS
recovery-
https:/ /oem-share. canonical. com/partners/ lyoncore/ share/artifacts /oem-scripts/ oem-scripts- 1.52-27279e5- in-linux- container- jammy