couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beno...@apache.org
Subject git commit: updated refs/heads/1994-merge-rcouch to 8cb69a9
Date Tue, 07 Jan 2014 16:28:44 GMT
Updated Branches:
  refs/heads/1994-merge-rcouch 5622151ce -> 8cb69a946


fix version number

display the release number when available instead of the couch
application version.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/8cb69a94
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/8cb69a94
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/8cb69a94

Branch: refs/heads/1994-merge-rcouch
Commit: 8cb69a9467cc4b57eeeb99bc83aa24e084abac73
Parents: 5622151
Author: Benoit Chesneau <benoitc@apache.org>
Authored: Tue Jan 7 17:27:28 2014 +0100
Committer: Benoit Chesneau <benoitc@apache.org>
Committed: Tue Jan 7 17:27:28 2014 +0100

----------------------------------------------------------------------
 apps/couch/c_src/couch_js/help.h    |  2 +-
 apps/couch/src/couch.app.src        | 23 -----------
 apps/couch/src/couch.app.src.script | 67 ++++++++++++++++++++++++++++++++
 apps/couch/src/couch.erl            |  9 +++++
 apps/couch/src/couch_server.erl     | 10 +----
 pkg.vars.config.in                  |  4 +-
 6 files changed, 81 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/8cb69a94/apps/couch/c_src/couch_js/help.h
----------------------------------------------------------------------
diff --git a/apps/couch/c_src/couch_js/help.h b/apps/couch/c_src/couch_js/help.h
index 81bae4d..f4ddb24 100644
--- a/apps/couch/c_src/couch_js/help.h
+++ b/apps/couch/c_src/couch_js/help.h
@@ -73,7 +73,7 @@ static const char USAGE_TEMPLATE[] =
             USAGE_TEMPLATE,                     \
             basename,                           \
             basename,                           \
-            VENDOR_NAME,                       \
+            PACKAGE_NAME,                       \
             basename,                           \
             PACKAGE_BUGREPORT)
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8cb69a94/apps/couch/src/couch.app.src
----------------------------------------------------------------------
diff --git a/apps/couch/src/couch.app.src b/apps/couch/src/couch.app.src
index 53cee43..e69de29 100644
--- a/apps/couch/src/couch.app.src
+++ b/apps/couch/src/couch.app.src
@@ -1,23 +0,0 @@
-{application, couch, [
-    {description, "Apache CouchDB"},
-    {vsn, "1.6.1"},
-    {registered, [
-        couch_config,
-        couch_db_update,
-        couch_db_update_notifier_sup,
-        couch_external_manager,
-        couch_httpd,
-        couch_log,
-        couch_primary_services,
-        couch_query_servers,
-        couch_secondary_services,
-        couch_server,
-        couch_server_sup,
-        couch_stats_aggregator,
-        couch_stats_collector,
-        couch_task_status
-    ]},
-    {mod, {couch_app, []}},
-    {applications, [kernel, stdlib, crypto, sasl, public_key, ssl,
-                    inets, oauth, ibrowse, mochiweb, os_mon]}
-]}.

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8cb69a94/apps/couch/src/couch.app.src.script
----------------------------------------------------------------------
diff --git a/apps/couch/src/couch.app.src.script b/apps/couch/src/couch.app.src.script
new file mode 100644
index 0000000..45b5333
--- /dev/null
+++ b/apps/couch/src/couch.app.src.script
@@ -0,0 +1,67 @@
+%% -*- tab-width: 4;erlang-indent-level: 4;indent-tabs-mode: nil -*-
+%% ex: ft=erlang ts=4 sw=4 et
+
+%% Licensed under the Apache License, Version 2.0 (the "License"); you may not
+%% use this file except in compliance with the License. You may obtain a copy of
+%% the License at
+%%
+%%   http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+%% WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+%% License for the specific language governing permissions and limitations under
+%% the License.
+
+
+Cfg = case file:consult("../../pkg.vars.config") of
+          {ok, Terms} ->
+              Terms;
+          _Err ->
+              []
+      end,
+
+%% get version infos
+MajorVersion = integer_to_list(proplists:get_value(version_major, Cfg, 0)),
+MinorVersion = integer_to_list(proplists:get_value(version_minor, Cfg, 0)),
+RevVersion = integer_to_list(proplists:get_value(version_revision, Cfg, 0)),
+StageVersion = proplists:get_value(version_stage, Cfg, ""),
+RelVersion = proplists:get_value(version_release, Cfg, ""),
+
+%% build the version
+BaseVersion = MajorVersion ++ "." ++ MinorVersion ++ "." ++ RevVersion,
+SecondaryVersion = StageVersion ++ RelVersion,
+RelVsn = case os:getenv("RELEASE") of
+    "1" ->
+        BaseVersion;
+    _ ->
+        BaseVersion ++ SecondaryVersion
+end,
+
+
+[
+    {application, couch, [
+        {description, "Apache CouchDB"},
+        {vsn, "1.6.1"},
+        {registered, [
+            couch_config,
+            couch_db_update,
+            couch_db_update_notifier_sup,
+            couch_external_manager,
+            couch_httpd,
+            couch_log,
+            couch_primary_services,
+            couch_query_servers,
+            couch_secondary_services,
+            couch_server,
+            couch_server_sup,
+            couch_stats_aggregator,
+            couch_stats_collector,
+            couch_task_status
+        ]},
+        {mod, {couch_app, []}},
+        {env, [{couch_rel, RelVsn}]},
+        {applications, [kernel, stdlib, crypto, sasl, public_key, ssl,
+                        inets, oauth, ibrowse, mochiweb, os_mon]}
+    ]}
+].

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8cb69a94/apps/couch/src/couch.erl
----------------------------------------------------------------------
diff --git a/apps/couch/src/couch.erl b/apps/couch/src/couch.erl
index 80e3261..92c2b74 100644
--- a/apps/couch/src/couch.erl
+++ b/apps/couch/src/couch.erl
@@ -14,6 +14,7 @@
 
 -export([get_app_env/2,
          version/0,
+         release_version/0,
          start/0,
          stop/0,
          restart/0,
@@ -33,6 +34,14 @@ version() ->
             "0.0.0"
     end.
 
+release_version() ->
+    case application:get_env(couch, couch_rel) of
+        {ok, Vsn} ->
+            Vsn;
+        _ ->
+            "0.0.0"
+    end.
+
 start() ->
     application:start(couch).
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8cb69a94/apps/couch/src/couch_server.erl
----------------------------------------------------------------------
diff --git a/apps/couch/src/couch_server.erl b/apps/couch/src/couch_server.erl
index 7cee0f5..4b80dfb 100644
--- a/apps/couch/src/couch_server.erl
+++ b/apps/couch/src/couch_server.erl
@@ -35,13 +35,7 @@ dev_start() ->
     couch:start().
 
 get_version() ->
-    Apps = application:loaded_applications(),
-    case lists:keysearch(couch, 1, Apps) of
-    {value, {_, _, Vsn}} ->
-        Vsn;
-    false ->
-        "0.0.0"
-    end.
+    couch:release_version().
 get_version(short) ->
   %% strip git hash from version string
   [Version|_Rest] = string:tokens(get_version(), "+"),
@@ -428,7 +422,7 @@ handle_cast(Msg, _Server) ->
 
 code_change(_OldVsn, State, _Extra) ->
     {ok, State}.
-    
+
 handle_info({'EXIT', _Pid, config_change}, Server) ->
     {noreply, shutdown, Server};
 handle_info({'EXIT', Pid, Reason}, Server) ->

http://git-wip-us.apache.org/repos/asf/couchdb/blob/8cb69a94/pkg.vars.config.in
----------------------------------------------------------------------
diff --git a/pkg.vars.config.in b/pkg.vars.config.in
index c562ee4..52140f5 100644
--- a/pkg.vars.config.in
+++ b/pkg.vars.config.in
@@ -44,8 +44,8 @@
 "specific language governing permissions and limitations\n"
 "under the License."}.
 
-{version_major, 1}.
-{version_minor, 6}.
+{version_major, 2}.
+{version_minor, 0}.
 {version_revision, 0}.
 {version_stage, "+build"}.
 {version_release, ".%revision%"}.


Mime
View raw message