WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-api

[Xen-API] [PATCH 1 of 3] Move the generation of ocaml/util/version.ml in

To: xen-api@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-API] [PATCH 1 of 3] Move the generation of ocaml/util/version.ml into the Makefile so that it can be done before the main build. This unbreaks the rpm build since 'hg id' will fail when run in a plain non-repo directory of sources
From: David Scott <dave.scott@xxxxxxxxxxxxx>
Date: Thu, 13 May 2010 23:27:27 +0100
Delivery-date: Thu, 13 May 2010 15:28:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <patchbomb.1273789646@xxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User David Scott <dave.scott@xxxxxxxxxxxxx>
# Date 1273789406 -3600
# Node ID 6a5c68b92b8b6e33464aa18986046e4ac1f30160
# Parent  4bde1604fc1795fe826574335f34b5e2c3c75594
Move the generation of ocaml/util/version.ml into the Makefile so that it can 
be done before the main build. This unbreaks the rpm build since 'hg id' will 
fail when run in a plain non-repo directory of sources.

Signed-off-by: David Scott <dave.scott@xxxxxxxxxxxxx>

diff -r 4bde1604fc17 -r 6a5c68b92b8b Makefile
--- a/Makefile  Thu Apr 29 10:22:35 2010 +0100
+++ b/Makefile  Thu May 13 23:23:26 2010 +0100
@@ -20,6 +20,10 @@
 .PHONY: phase3
 phase3:
        omake phase3
+
+.PHONY: version
+version:
+       omake version
 
 .PHONY: api
 api: all
diff -r 4bde1604fc17 -r 6a5c68b92b8b mk/Makefile
--- a/mk/Makefile       Thu Apr 29 10:22:35 2010 +0100
+++ b/mk/Makefile       Thu May 13 23:23:26 2010 +0100
@@ -46,6 +46,7 @@
 
 $(OUTPUT_XAPI) $(OUTPUT_XAPI_DEVEL) $(OUTPUT_CLI_RT) $(OUTPUT_SDK): $(call 
hg_req,xen-api) $(MY_MAIN_PACKAGES)/.dirstamp
        $(MAKE) clean
+       $(MAKE) -C $(REPO) version
        $(MAKE) -C $(REPO)
 
        rm -rf $(STAGING) $(STAGING_CLI_RT)
diff -r 4bde1604fc17 -r 6a5c68b92b8b ocaml/util/OMakefile
--- a/ocaml/util/OMakefile      Thu Apr 29 10:22:35 2010 +0100
+++ b/ocaml/util/OMakefile      Thu May 13 23:23:26 2010 +0100
@@ -19,14 +19,14 @@
 
 OCamlLibrary(encodings, encodings)
 
-version.ml: version.template
-       sed -e "s/@@@HG_ID@@@/$(shell hg id | sed -r 's/(.+)\s.*/\1/g')/" \
-           -e "s/@@@HOSTNAME@@@/$(shell hostname)/" \
-           -e "s/@@@DATE@@@/$(shell date -u +%Y-%m-%d)/" \
-           -e "s/@@@PRODUCT_VERSION@@@/$(PRODUCT_VERSION)/" \
-           -e "s/@@@PRODUCT_BRAND@@@/$(PRODUCT_BRAND)/" \
-           -e "s/@@@BUILD_NUMBER@@@/$(BUILD_NUMBER)/" \
-           < $< > $@
+.PHONY: version
+version:
+       echo "let hg_id = \\"$(shell hg id | sed -r 's/(.+)\s.*/\1/g')\\"" > 
version.ml
+       echo "let hostname = \\"$(shell hostname)\\"" >> version.ml
+       echo "let date = \\"$(shell date -u +%Y-%m-%d)\\"" >> version.ml
+       echo "let product_version = \\"$(PRODUCT_VERSION)\\"" >> version.ml
+       echo "let product_brand = \\"$(PRODUCT_BRAND)\\"" >> version.ml
+       echo "let build_number = \\"$(BUILD_NUMBER)\\"" >> version.ml
 
 .PHONY: clean
 clean:
diff -r 4bde1604fc17 -r 6a5c68b92b8b ocaml/util/version.template
--- a/ocaml/util/version.template       Thu Apr 29 10:22:35 2010 +0100
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-let hg_id = "@@@HG_ID@@@"
-let hostname = "@@@HOSTNAME@@@"
-let date = "@@@DATE@@@"
-let product_version = "@@@PRODUCT_VERSION@@@"
-let product_brand = "@@@PRODUCT_BRAND@@@"
-let build_number = "@@@BUILD_NUMBER@@@"
4 files changed, 13 insertions(+), 14 deletions(-)
Makefile                    |    4 ++++
mk/Makefile                 |    1 +
ocaml/util/OMakefile        |   16 ++++++++--------
ocaml/util/version.template |    6 ------


Attachment: xen-api.hg-3.patch
Description: Text Data

_______________________________________________
xen-api mailing list
xen-api@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/mailman/listinfo/xen-api
<Prev in Thread] Current Thread [Next in Thread>