Permalink
Browse files

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 <mike.mcclurg@citrix.com>
  • Loading branch information...
Mike McClurg
Mike McClurg committed Nov 29, 2011
1 parent e5a51bf commit 8701f1a78a05a8884cb7b3319ec12f960806c588
Showing with 8 additions and 3 deletions.
  1. +3 −1 Makefile
  2. +1 −0 VERSION
  3. +2 −0 ocaml/util/version.mli
  4. +2 −2 ocaml/xapi/xapi_globs.ml
View
@@ -86,7 +86,9 @@ version:
let product_version_text_short = \"$(PRODUCT_VERSION_TEXT_SHORT)\" \n \
let platform_version = Util_inventory.lookup ~default:\"\" \"PLATFORM_VERSION\" \n \
let product_brand = \"$(PRODUCT_BRAND)\" \n \
- let build_number = Util_inventory.lookup ~default:\"$(BUILD_NUMBER)\" \"BUILD_NUMBER\" \n" \
+ let build_number = Util_inventory.lookup ~default:\"$(BUILD_NUMBER)\" \"BUILD_NUMBER\" \n \
+ let xapi_version_major = $(shell cut -d. -f1 VERSION) \n \
+ let xapi_version_minor = $(shell cut -d. -f2 VERSION) \n" \
> ocaml/util/version.ml
.PHONY: clean
View
@@ -0,0 +1 @@
+1.3
View
@@ -7,3 +7,5 @@ val product_version_text_short : string
val platform_version: string
val product_brand : string
val build_number : string
+val xapi_version_major : int
+val xapi_version_minor : int
View
@@ -27,8 +27,8 @@ let pool_secret = ref ""
let localhost_ref : [`host] Ref.t ref = ref Ref.null
(* xapi version *)
-let version_major = 1
-let version_minor = 3
+let version_major = Version.xapi_version_major
+let version_minor = Version.xapi_version_minor
let xapi_user_agent = "xapi/"^(string_of_int version_major)^"."^(string_of_int version_minor)
(* api version *)

0 comments on commit 8701f1a

Please sign in to comment.