Skip to content
Snippets Groups Projects
Commit 5793de43 authored by Augustin Lemesle's avatar Augustin Lemesle
Browse files

Merge branch 'changelog/generator' of git.frama-c.com:pub/pub.frama-c.com into changelog/generator

parents 422abc00 69068faf
No related branches found
No related tags found
1 merge request!66Changelog generator now takes in account WP and E-ACSL
No preview for this file type
...@@ -254,13 +254,18 @@ and text e = parse ...@@ -254,13 +254,18 @@ and text e = parse
{ major; minor; patch } { major; minor; patch }
(* compares both old-style (YYYYMMDD) and new-style numbering (MAJOR.MINOR) (* compares both old-style (YYYYMMDD) and new-style numbering (MAJOR.MINOR)
note: codenames are only used in case of equality note: codenames are only used for old versions or in case of equality
*) *)
let compare_version v1 v2 cn1 cn2 = let compare_version v1 v2 cn1 cn2 =
let re_old_numbering = Str.regexp "[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9].*" in let re_old_numbering = Str.regexp ".*\\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\\)" in
let is_old_numbering v = Str.string_match re_old_numbering v 0 in let is_old_numbering v = Str.string_match re_old_numbering v 0 in
match is_old_numbering v1, is_old_numbering v2 with let get_old_version v =
| true, true -> String.compare v2 v1 let v = String.map (fun c -> if c = '_' then '-' else c) v in
assert(Str.string_match re_old_numbering v 0) ;
Str.matched_group 1 v
in
match is_old_numbering cn1, is_old_numbering cn2 with
| true, true -> String.compare (get_old_version cn2) (get_old_version cn1)
| false, true -> (* new numbering is always newer *) -1 | false, true -> (* new numbering is always newer *) -1
| true, false -> (* old numbering is always older *) 1 | true, false -> (* old numbering is always older *) 1
| false, false -> (* compare new-style versions *) | false, false -> (* compare new-style versions *)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment