Treat kernel version condition as a list of quoted checks

Before only one comparison was allowed. Let's make this more flexible:
ConditionKernelVersion = ">=4.0" "<=4.5"

Fixes #12881.

This also fixes expressions like "ConditionKernelVersion=>" which would
evaluate as true.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-06-28 10:58:06 +02:00
parent fd4487f01a
commit 910c6d0931
4 changed files with 72 additions and 10 deletions

View File

@@ -2,6 +2,8 @@
Description=Test for basic execution
ConditionKernelVersion=">=3.0"
ConditionKernelVersion=">=2.0" "<=60" "!=1.4"
ConditionKernelVersion=" >= 2.0" " <= 60 " "!= 1.4"
ConditionKernelVersion=" >= 2.0" " * " "*.*"
[Service]
ExecStart=touch /tmp/a ; /bin/sh -c 'touch /tmp/b' ; touch /tmp/c