From 99a22f6ba4cb9c0ee70a1a496c463e3356bf2da2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=BA=E8=83=BD=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Mon, 18 Nov 2024 21:59:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8A=82=E7=82=B9=E7=89=88=E6=9C=AC=E5=8C=B9?= =?UTF-8?q?=E9=85=8D=E6=97=B6=EF=BC=8C=E6=94=AF=E6=8C=81runtime=E7=9A=84?= =?UTF-8?q?=E5=A4=A7=E4=BA=8E=E5=B0=8F=E4=BA=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...347\202\271\347\211\210\346\234\254.Biz.cs" | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git "a/Stardust.Data/Nodes/\350\212\202\347\202\271\347\211\210\346\234\254.Biz.cs" "b/Stardust.Data/Nodes/\350\212\202\347\202\271\347\211\210\346\234\254.Biz.cs" index 9ae51e8e..3d88e6ae 100644 --- "a/Stardust.Data/Nodes/\350\212\202\347\202\271\347\211\210\346\234\254.Biz.cs" +++ "b/Stardust.Data/Nodes/\350\212\202\347\202\271\347\211\210\346\234\254.Biz.cs" @@ -297,6 +297,24 @@ public String MatchResult(Node node) var runtime = node.Runtime; if (runtime.IsNullOrEmpty() || !vs.Any(e => e.IsMatch(runtime))) return $"[{runtime}] not Match {vs.Join(",")}"; } + else if (Rules.TryGetValue("runtime>", out vs)) + { + var str = node.Runtime; + if (str.IsNullOrEmpty()) return "Version is null"; + if (!System.Version.TryParse(str, out var ver1)) return $"Runtime=[{str}] is invalid"; + if (!System.Version.TryParse(vs[0], out var ver2)) return $"vs[0]=[{vs[0]}] is invalid"; + + if (ver1 < ver2) return $"Runtime=[{ver1}] < {ver2}"; + } + else if (Rules.TryGetValue("runtime<", out vs)) + { + var str = node.Runtime; + if (str.IsNullOrEmpty()) return "Version is null"; + if (!System.Version.TryParse(str, out var ver1)) return $"Runtime=[{str}] is invalid"; + if (!System.Version.TryParse(vs[0], out var ver2)) return $"vs[0]=[{vs[0]}] is invalid"; + + if (ver1 > ver2) return $"Runtime=[{ver1}] > {ver2}"; + } if (Rules.TryGetValue("framework", out vs)) {