couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [27/42] git commit: updated refs/heads/master to a4d6cd4
Date Thu, 03 Oct 2013 14:13:40 GMT
add inline comments


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

Branch: refs/heads/master
Commit: 0f7a4efa663da5dea5d89afb773518535038beec
Parents: 2bed2a5
Author: Jan Lehnardt <jan@apache.org>
Authored: Fri Aug 2 18:17:05 2013 +0200
Committer: Jan Lehnardt <jan@apache.org>
Committed: Thu Oct 3 16:08:36 2013 +0200

----------------------------------------------------------------------
 src/couch_plugins/README.md             |  2 ++
 src/couch_plugins/src/couch_plugins.erl | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/0f7a4efa/src/couch_plugins/README.md
----------------------------------------------------------------------
diff --git a/src/couch_plugins/README.md b/src/couch_plugins/README.md
index c75b87d..02a83ce 100644
--- a/src/couch_plugins/README.md
+++ b/src/couch_plugins/README.md
@@ -85,6 +85,8 @@ Milestone X: Later
  - Add some account/identity/maybe crypto-web-of-trust system for
    authors to publish “legit” plugins.
  - Sign & verify individual releases.
+ - Handle unclean un/installs if CouchDB crashes while installing/
+   uninstalling
 
 A few more things that can happen concurrently depending on what
 plugins require:

http://git-wip-us.apache.org/repos/asf/couchdb/blob/0f7a4efa/src/couch_plugins/src/couch_plugins.erl
----------------------------------------------------------------------
diff --git a/src/couch_plugins/src/couch_plugins.erl b/src/couch_plugins/src/couch_plugins.erl
index dfd59a2..7adadc4 100644
--- a/src/couch_plugins/src/couch_plugins.erl
+++ b/src/couch_plugins/src/couch_plugins.erl
@@ -51,10 +51,30 @@ install({Name, _BaseUrl, Version, Checksums}=Plugin) ->
 
   ok.
 
+%% * * *
+
+
+%% Plugin Registration
+%% On uninstall:
+%%  - add plugins/name = version to config
+%% On uninstall:
+%%  - remove plugins/name from config
+
 -spec register_plugin(string(), string()) -> ok.
 register_plugin(Name, Version) ->
   couch_config:set("plugins", Name, Version).
 
+-spec unregister_plugin(string()) -> ok.
+unregister_plugin(Name) ->
+  couch_config:delete("plugins", Name).
+
+%% * * *
+
+
+%% Load Config
+%% Pareses <plugindir>/priv/default.d/<pluginname.ini> and applies
+%% the contents to the config system.
+
 -spec load_config(string(), string()) -> ok.
 load_config(Name, Version) ->
     lists:foreach(
@@ -73,6 +93,10 @@ load_config_file(File) ->
 set_config({{Section, Key}, Value}) ->
     ok = couch_config:set(Section, Key, Value, false).
 
+%% * * *
+
+
+
 -spec add_code_path(string(), string()) -> ok | {error, bad_directory}.
 add_code_path(Name, Version) ->
   PluginPath = plugin_dir() ++ "/" ++ get_file_slug(Name, Version) ++ "/ebin",


Mime
View raw message