diff --git a/ChangeLog b/ChangeLog index 0cb22aff9..e0bb52ad1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-06-18 Badlop + + * src/ejabberd.app: The ejabberd version number is defined in the + OTP application resource file, in the key 'vsn' (EJAB-657) + * src/ejabberd.hrl: The macro VERSION now consults the ejabberd + application key vsn + * src/configure.erl: Load the ejabberd application description + * doc/Makefile: Read ejabberd version from ejabberd.app vsn + * doc/api/Makefile: Likewise + 2008-06-18 Christophe Romain * src/mod_pubsub/mod_pubsub.erl: get_default bugfix (EJAB-656) diff --git a/doc/Makefile b/doc/Makefile index bab623dcf..c1f35fdff 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -21,7 +21,7 @@ release: @echo "Press any key to continue" @read foo @echo "% ejabberd version (automatically generated)." > version.tex - @echo "\newcommand{\version}{"`sed '/VERSION/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../src/ejabberd.hrl`"}" >> version.tex + @echo "\newcommand{\version}{"`sed '/vsn/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../src/ejabberd.app`"}" >> version.tex @echo -n "% Contributed modules (automatically generated)." > contributed_modules.tex @echo -e "$(CONTRIBUTED_MODULES)" >> contributed_modules.tex diff --git a/doc/api/Makefile b/doc/api/Makefile index a4c8dbb7c..de356ef20 100644 --- a/doc/api/Makefile +++ b/doc/api/Makefile @@ -1,5 +1,5 @@ APPNAME = ejabberd -VSN = $(shell sed '/VERSION/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../../src/ejabberd.hrl) +VSN = $(shell sed '/vsn/!d;s/\(.*\)"\(.*\)"\(.*\)/\2/' ../../src/ejabberd.app) DOCDIR=. SRCDIR=../../src diff --git a/src/configure.erl b/src/configure.erl index f39305b31..b9447c28d 100644 --- a/src/configure.erl +++ b/src/configure.erl @@ -60,6 +60,8 @@ start() -> EVersion = "ERLANG_VERSION = " ++ erlang:system_info(version) ++ "\n", EIDirS = "EI_DIR = " ++ code:lib_dir("erl_interface") ++ "\n", RootDirS = "ERLANG_DIR = " ++ code:root_dir() ++ "\n", + %% Load the ejabberd application description so that ?VERSION can read the vsn key + application:load(ejabberd), Version = "EJABBERD_VERSION = " ++ ?VERSION ++ "\n", ExpatDir = "EXPAT_DIR = c:\\sdk\\Expat-2.0.0\n", OpenSSLDir = "OPENSSL_DIR = c:\\sdk\\OpenSSL\n", diff --git a/src/ejabberd.app b/src/ejabberd.app index ce527086c..1ff41ec46 100644 --- a/src/ejabberd.app +++ b/src/ejabberd.app @@ -2,7 +2,7 @@ {application, ejabberd, [{description, "ejabberd"}, - {vsn, "2.0.0"}, + {vsn, "2.1.0-alpha"}, {modules, [acl, adhoc, configure, diff --git a/src/ejabberd.hrl b/src/ejabberd.hrl index 1c199b6fc..d7b16f1e2 100644 --- a/src/ejabberd.hrl +++ b/src/ejabberd.hrl @@ -19,7 +19,9 @@ %%% %%%---------------------------------------------------------------------- --define(VERSION, "2.1.0-alpha"). +%% This macro returns a string of the ejabberd version running, e.g. "2.3.4" +%% If the ejabberd application description isn't loaded, returns atom: undefined +-define(VERSION, element(2, application:get_key(ejabberd,vsn))). -define(MYHOSTS, ejabberd_config:get_global_option(hosts)). -define(MYNAME, hd(ejabberd_config:get_global_option(hosts))).