]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Remove 'v' prefix from systemd tool versions
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 13 Apr 2024 18:31:32 +0000 (20:31 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 14 Apr 2024 13:47:28 +0000 (15:47 +0200)
Some older systemd versions still have a 'v' prefix in them, let's
make sure we take that into account.

mkosi/config.py

index 1fe456922e38b3bfae9e215f604f61af58365078..71ce74f79df7535df6420a323503ab4db008284c 100644 (file)
@@ -4224,5 +4224,9 @@ def want_selinux_relabel(config: Config, root: Path, fatal: bool = True) -> Opti
 
 def systemd_tool_version(config: Config, tool: PathString) -> GenericVersion:
     return GenericVersion(
-        run([tool, "--version"], stdout=subprocess.PIPE, sandbox=config.sandbox()).stdout.split()[2].strip("()")
+        run(
+            [tool, "--version"],
+            stdout=subprocess.PIPE,
+            sandbox=config.sandbox()
+        ).stdout.split()[2].strip("()").removeprefix("v")
     )