Skip to content

Commit 9903379

Browse files
authored
fix: Xen Version checks (#6708)
I missed a few cases...
2 parents 6ba0653 + 6c76c12 commit 9903379

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

ocaml/tests/test_helpers.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,8 @@ module Version = struct
507507
, [25; 15; 0; 13]
508508
)
509509
; ("Default version", "0.0.0", [0; 0; 0])
510+
; ("Xen Debug build version", "4.17.5-20-d", [4; 17; 5; 20])
511+
; ("Xen dev build version", "4.17.5-20.abcd", [4; 17; 5; 20])
510512
]
511513
in
512514
let test_version_numbers (description, version_string, expected) =

ocaml/xapi/helpers.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -937,9 +937,9 @@ module Checks = struct
937937

938938
let version_numbers_of_string version_string =
939939
( match String.split_on_char '-' version_string with
940-
| [standard_version; patch] ->
941-
String.split_on_char '.' standard_version @ [patch]
942-
| [standard_version] ->
940+
| standard_version :: patch :: _ ->
941+
List.concat_map (String.split_on_char '.') [standard_version; patch]
942+
| standard_version :: [] ->
943943
String.split_on_char '.' standard_version
944944
| _ ->
945945
["0"; "0"; "0"]

0 commit comments

Comments
 (0)