]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Return full version from systemd_tool_version()
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 10 Dec 2023 16:10:33 +0000 (17:10 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 10 Dec 2023 16:12:12 +0000 (17:12 +0100)
Let's allow comparing against stable releases as well by returning
the full version.

mkosi/__init__.py

index 066df44c54b16bfc8f668670cff2cd7614383002..4b3b8a8ba0369be4d257a25d5534a31be246d010 100644 (file)
@@ -1848,7 +1848,7 @@ def check_outputs(config: MkosiConfig) -> None:
 
 
 def systemd_tool_version(tool: PathString) -> GenericVersion:
-    return GenericVersion(run([tool, "--version"], stdout=subprocess.PIPE).stdout.split()[1])
+    return GenericVersion(run([tool, "--version"], stdout=subprocess.PIPE).stdout.split()[2].strip("()"))
 
 
 def check_systemd_tool(*tools: PathString, version: str, reason: str, hint: Optional[str] = None) -> None: