Skip to content

Commit

Permalink
Fix update_kernel_commits.py to keep '-' in platform names
Browse files Browse the repository at this point in the history
After nvidia platforms were introduced the logic to generate variables
from branches is broken because of e.g. 'nvidia-jp6'

Signed-off-by: Mikhail Malyshev <[email protected]>
  • Loading branch information
rucoder committed Feb 13, 2025
1 parent 41289af commit 065da23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/update_kernel_commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@ def branch_commit_to_variable(branch_name, commit):
Returns:
- str: The variable name in the expected format.
"""
variable_name = branch_name.replace("eve-kernel-", "KERNEL_COMMIT_").replace("-", "_")
m = re.match(r"(?P<branch>.*v\d+\.\d+(?:\.\d+)?)-(?P<platform>.*)", branch_name)

Check failure on line 120 in tools/update_kernel_commits.py

View workflow job for this annotation

GitHub Actions / yetus

pylint:[C0103(invalid-name), branch_commit_to_variable] Variable name "m" doesn't conform to snake_case naming style

if not m:
exit(f"Error: Invalid branch name format: {branch_name}")

Check failure on line 123 in tools/update_kernel_commits.py

View workflow job for this annotation

GitHub Actions / yetus

pylint:[R1722(consider-using-sys-exit), branch_commit_to_variable] Consider using 'sys.exit' instead

branch_name = m.group("branch").replace("eve-kernel-", "KERNEL_COMMIT_").replace("-", "_")
variable_name = branch_name + "_" + m.group("platform")
return f"{variable_name} = {commit}\n"


Expand Down

0 comments on commit 065da23

Please sign in to comment.