You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ra...@apache.org on 2011/10/04 23:26:32 UTC

git commit: vendor info in welcome message (COUCHDB-1285)

Updated Branches:
  refs/heads/master 37afbce7c -> 3c24a94dd


vendor info in welcome message (COUCHDB-1285)


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

Branch: refs/heads/master
Commit: 3c24a94dde5598ec03e0e6d8dec5b697b4eff247
Parents: 37afbce
Author: Randall Leeds <ra...@apache.org>
Authored: Tue Oct 4 14:10:13 2011 -0700
Committer: Randall Leeds <ra...@apache.org>
Committed: Tue Oct 4 14:11:33 2011 -0700

----------------------------------------------------------------------
 etc/couchdb/Makefile.am                   |    6 ++++++
 etc/couchdb/default.ini.tpl.in            |    3 +++
 src/couchdb/couch_httpd_misc_handlers.erl |    8 +++++++-
 3 files changed, 16 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/3c24a94d/etc/couchdb/Makefile.am
----------------------------------------------------------------------
diff --git a/etc/couchdb/Makefile.am b/etc/couchdb/Makefile.am
index 9367cea..dd1054b 100644
--- a/etc/couchdb/Makefile.am
+++ b/etc/couchdb/Makefile.am
@@ -35,6 +35,8 @@ default.ini: default.ini.tpl
 	    -e "s|%localstaterundir%|../var/run/couchdb|g" \
 	    -e "s|%couchprivlibdir%|../lib/couch-$(version)/priv/lib|g" \
 	    -e "s|%couchjs_command_name%|couchjs.exe|g" \
+	    -e "s|%package_author_name%|$(package_author_name)|g" \
+	    -e "s|%version%|$(version)|g" \
 	< $< > $@
 else
 default.ini: default.ini.tpl
@@ -47,6 +49,8 @@ default.ini: default.ini.tpl
 	    -e "s|%localstaterundir%|$(localstaterundir)|g" \
 	    -e "s|%couchprivlibdir%|$(couchprivlibdir)|g" \
 	    -e "s|%couchjs_command_name%|$(couchjs_command_name)|g" \
+	    -e "s|%package_author_name%|$(package_author_name)|g" \
+	    -e "s|%version%|$(version)|g" \
 	< $< > $@
 endif
 
@@ -60,6 +64,8 @@ default_dev.ini: default.ini.tpl
 	    -e "s|%localstaterundir%|$(abs_top_builddir)/tmp/run|g" \
 	    -e "s|%couchprivlibdir%|$(devcouchprivlibdir)|g" \
 	    -e "s|%couchjs_command_name%|$(couchjs_dev_command_name)|g" \
+	    -e "s|%package_author_name%|$(package_author_name)|g" \
+	    -e "s|%version%|$(version)|g" \
 	< $< > $@
 
 # Noah said to not specify local.ini but it borks

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3c24a94d/etc/couchdb/default.ini.tpl.in
----------------------------------------------------------------------
diff --git a/etc/couchdb/default.ini.tpl.in b/etc/couchdb/default.ini.tpl.in
index 12bc20f..7fd3cb4 100644
--- a/etc/couchdb/default.ini.tpl.in
+++ b/etc/couchdb/default.ini.tpl.in
@@ -1,6 +1,9 @@
 ; @configure_input@
 
 ; Upgrading CouchDB will overwrite this file.
+[vendor]
+name = %package_author_name%
+version = %version%
 
 [couchdb]
 database_dir = %localstatelibdir%

http://git-wip-us.apache.org/repos/asf/couchdb/blob/3c24a94d/src/couchdb/couch_httpd_misc_handlers.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl
index ff35571..8abf0aa 100644
--- a/src/couchdb/couch_httpd_misc_handlers.erl
+++ b/src/couchdb/couch_httpd_misc_handlers.erl
@@ -33,7 +33,13 @@ handle_welcome_req(#httpd{method='GET'}=Req, WelcomeMessage) ->
     send_json(Req, {[
         {couchdb, WelcomeMessage},
         {version, list_to_binary(couch_server:get_version())}
-    ]});
+        ] ++ case couch_config:get("vendor") of
+        [] ->
+            [];
+        Properties ->
+            [{vendor, {[{?l2b(K), ?l2b(V)} || {K, V} <- Properties]}}]
+        end
+    });
 handle_welcome_req(Req, _) ->
     send_method_not_allowed(Req, "GET,HEAD").