summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-08-18 15:29:36 -0600
committerCommit Bot <commit-bot@chromium.org>2021-08-19 21:04:10 +0000
commitb8bf42b33a30e11d2a97fac4e897cfde76d6ca0d (patch)
tree818a532f08716445fe79961fd9561332620448d0 /zephyr
parent10809eb023d475681b45863e68d906fae4667eda (diff)
downloadchrome-ec-b8bf42b33a30e11d2a97fac4e897cfde76d6ca0d.tar.gz
zephyr: zmake: organize the commit hashes a bit better
- Put EC repo first, since that's probably the most useful commit hash. - Put Zephyr kernel second, since that's probably the second most useful commit hash. - Put all other modules after that, alphasorted. BUG=b:184832251 BRANCH=none TEST=updated unit tests Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Id14e9706980d733637e29643dd355aaa82a51fc2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3105265 Reviewed-by: Yuval Peress <peress@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/zmake/tests/test_version.py6
-rw-r--r--zephyr/zmake/zmake/version.py8
2 files changed, 10 insertions, 4 deletions
diff --git a/zephyr/zmake/tests/test_version.py b/zephyr/zmake/tests/test_version.py
index 4407e52642..8fb4a09435 100644
--- a/zephyr/zmake/tests/test_version.py
+++ b/zephyr/zmake/tests/test_version.py
@@ -76,21 +76,21 @@ def _setup_example_repos(tmp_path):
_git_commit(mod1)
# Has two commits.
- mod2 = tmp_path / "mod2"
+ mod2 = tmp_path / "ec"
_git_init(mod2)
_git_add(mod2, mod2 / "file2")
_git_commit(mod2)
_git_add(mod2, mod2 / "file3")
_git_commit(mod2)
- return project, zephyr_base, {"mod1": mod1, "mod2": mod2}
+ return project, zephyr_base, {"mod1": mod1, "ec": mod2}
def test_version_string(tmp_path):
project, zephyr_base, modules = _setup_example_repos(tmp_path)
assert (
version.get_version_string(project, zephyr_base, modules)
- == "prj_v2.6.4-mod1:02fd7a,mod2:b5991f,os:377d26"
+ == "prj_v2.6.4-ec:b5991f,os:377d26,mod1:02fd7a"
)
diff --git a/zephyr/zmake/zmake/version.py b/zephyr/zmake/zmake/version.py
index 5312c8697e..2d505769f2 100644
--- a/zephyr/zmake/zmake/version.py
+++ b/zephyr/zmake/zmake/version.py
@@ -106,7 +106,13 @@ def get_version_string(project, zephyr_base, modules, static=False):
vcs_hashes = ",".join(
"{}:{}".format(name, _get_revision(repo)[:6])
- for name, repo in sorted(repos.items())
+ for name, repo in sorted(
+ repos.items(),
+ # Put the EC module first, then Zephyr OS kernel, as
+ # these are probably the most important hashes to
+ # developers.
+ key=lambda p: (p[0] != "ec", p[0] != "os", p),
+ )
)
return "{}_v{}.{}.{}-{}".format(