From 6e8fac1e6dbe2068fc0cfca741c8ea4192d08e89 Mon Sep 17 00:00:00 2001
From: Sylvain Pogodalla <sylvain.pogodalla@inria.fr>
Date: Wed, 22 Oct 2008 09:12:05 +0000
Subject: [PATCH] Version management added

---
 Makefile.in                 | 7 ++-----
 src/grammars/interactive.ml | 3 ++-
 src/scripting/acg.ml        | 5 ++++-
 src/utils/version.ml        | 2 +-
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 078e3d10..15f8fbdb 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -22,7 +22,7 @@ PHONY: config byte opt clean superclean install tar version release
 BINARIES=acgc acgc.opt acg acg.opt
 
 VERSION_FILE = src/utils/version.ml
-VERSION = $(shell date "+%Y%m%d-%M")
+VERSION = $(shell date "+%Y%m%d")
 RELEASE = acg-$(VERSION)
 
 TAR_RELEASE =acg-$(TAR_VERSION)
@@ -33,9 +33,6 @@ prefix = @prefix@
 exec_prefix = @exec_prefix@
 
 
-essai: TAR_VERSION=$(shell grep "^DEFINE" $(VERSION_FILE) | sed -e 's/DEFINE.* = "\(.*\)"/\1/')
-essai: 
-	echo "$(TAR_VERSION)" "$(TAR_RELEASE)"
 
 byte opt: 
 	$(MAKE) -C src $@
@@ -81,4 +78,4 @@ version :
 	sed -i 's/\(VERSION = \)".*"/\1"$(VERSION)"/' $(VERSION_FILE)
 
 release : version tar
-	if svn status -q -u | grep -v "^Status against" | grep -q -v "^\?" ; then echo "Please commit before making a release" ; else $(MAKE) superclean ; svn cp svn+ssh://pogodall@scm.gforge.inria.fr/svn/acg/dev/trunk svn+ssh://pogodall@scm.gforge.inria.fr/svn/acg/dev/tags/release-$(VERSION) -m "Tagging the $(VERSION) release of the 'acg' project" ; fi
\ No newline at end of file
+	if svn status -q -u | grep -v "^Status against" | grep -q -v "^\?" ; then printf "\n\nERROR:\nPlease commit before making a release\n\n" ; else $(MAKE) superclean ; svn cp svn+ssh://pogodall@scm.gforge.inria.fr/svn/acg/dev/trunk svn+ssh://pogodall@scm.gforge.inria.fr/svn/acg/dev/tags/release-$(VERSION) -m "Tagging the $(VERSION) release of the 'acg' project" ; fi
\ No newline at end of file
diff --git a/src/grammars/interactive.ml b/src/grammars/interactive.ml
index 80203e78..c335c3bd 100644
--- a/src/grammars/interactive.ml
+++ b/src/grammars/interactive.ml
@@ -26,7 +26,8 @@ let dirs = ref [""]
 
 let options =
   [
-  ("-i", Arg.Set interactive , " Enter the interaction loop to parse terms according to signatures");
+    ("-version", Arg.Unit (fun () -> Printf.printf "%s\n" Version.version;exit 0), " Prints the version number");
+    ("-i", Arg.Set interactive , " Enters the interaction loop to parse terms according to signatures");
     ("-I", Arg.String (fun dir -> dirs := (!dirs)@[dir]) , " -I dir sets dir as a directory in which file arguments can be looked for")
   ]
   
diff --git a/src/scripting/acg.ml b/src/scripting/acg.ml
index b68c2d54..dbac3eb3 100644
--- a/src/scripting/acg.ml
+++ b/src/scripting/acg.ml
@@ -27,6 +27,7 @@ let dirs = ref [""]
 
 let options =
   [
+    ("-version", Arg.Unit (fun () -> Printf.printf "%s\n" Version.version;exit 0), " Prints the version number");
     ("-I", Arg.String (fun dir -> dirs := (!dirs)@[dir]) , " -I dir sets dir as a directory in which file arguments can be looked for")
   ]
 
@@ -42,7 +43,9 @@ module P = Script_parser.Make(E)
 
 
 let welcome_msg = 
-  "\n\t\t\tWelcome to the ACG toplevel\n\t\t\t\t�INRIA 2008\nPlease send your comments or bug reports or featrure requests to sylvain.pogodalla@loria.fr\n\n\nType\n\t\thelp ;\nto get help.\n\n\n\n"
+  Printf.sprintf
+    "\n\t\t\tWelcome to the ACG toplevel\n\t\t\t    Version %s\n\t\t\t\t�INRIA 2008\nPlease send your comments or bug reports or featrure requests to sylvain.pogodalla@loria.fr\n\n\nType\n\t\thelp ;\nto get help.\n\n\n\n"
+    Version.version
 
 
 let env = ref E.empty
diff --git a/src/utils/version.ml b/src/utils/version.ml
index 5007226d..18268045 100644
--- a/src/utils/version.ml
+++ b/src/utils/version.ml
@@ -17,7 +17,7 @@
 (*                                                                        *)
 (**************************************************************************)
 
-DEFINE VERSION = "20081022-49"
+DEFINE VERSION = "20081022"
 
 
 let version = VERSION
-- 
GitLab