Skip to content

Commit 8701f1a

Browse files
author
Mike McClurg
committed
Add VERSION file to set xapi version
Add the VERSION file, and have the Makefile inject this version string into version.ml. We also update xapi_globs.ml to reference version.ml for the xapi major and minor version, instead of hardcoding it there. Signed-off-by: Mike McClurg <[email protected]>
1 parent e5a51bf commit 8701f1a

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ version:
8686
let product_version_text_short = \"$(PRODUCT_VERSION_TEXT_SHORT)\" \n \
8787
let platform_version = Util_inventory.lookup ~default:\"\" \"PLATFORM_VERSION\" \n \
8888
let product_brand = \"$(PRODUCT_BRAND)\" \n \
89-
let build_number = Util_inventory.lookup ~default:\"$(BUILD_NUMBER)\" \"BUILD_NUMBER\" \n" \
89+
let build_number = Util_inventory.lookup ~default:\"$(BUILD_NUMBER)\" \"BUILD_NUMBER\" \n \
90+
let xapi_version_major = $(shell cut -d. -f1 VERSION) \n \
91+
let xapi_version_minor = $(shell cut -d. -f2 VERSION) \n" \
9092
> ocaml/util/version.ml
9193

9294
.PHONY: clean

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.3

ocaml/util/version.mli

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ val product_version_text_short : string
77
val platform_version: string
88
val product_brand : string
99
val build_number : string
10+
val xapi_version_major : int
11+
val xapi_version_minor : int

ocaml/xapi/xapi_globs.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ let pool_secret = ref ""
2727
let localhost_ref : [`host] Ref.t ref = ref Ref.null
2828

2929
(* xapi version *)
30-
let version_major = 1
31-
let version_minor = 3
30+
let version_major = Version.xapi_version_major
31+
let version_minor = Version.xapi_version_minor
3232
let xapi_user_agent = "xapi/"^(string_of_int version_major)^"."^(string_of_int version_minor)
3333

3434
(* api version *)

0 commit comments

Comments
 (0)