anchor.diff:  
   % Idempotent uninstall, if you uninstall a non-existant
   % plugin, you get an `ok`.
  -% -spec uninstall(string()) -> ok | {error, string()}.
  -% uninstall(Name) ->
  -%   % unload app
  -%   ok = unload_plugin(Name),
  -%   log("plugin unloaded"),
  -
  -%   % unload config
  -%   ok = unload_config(Name),
  -%   log("config unloaded"),
  -
  -%   % delete files
  -%   ok = delete_files(Name),
  -%   log("files deleted"),
  -
  -%   % remove code path
  -%   ok = remove_code_path(Name),
  -%   log("removed code path"),
  -
  -%   % unregister plugin
  -%   ok = unregister_plugin(Name),
  -%   log("unregistered plugin"),
  -
  -%   % done
  -%   ok.
  +-spec uninstall(plugin()) -> ok | {error, string()}.
  +uninstall({Name, _BaseUrl, Version, _Checksums}) ->
  +  % unload app
  +  ok = unload_plugin(Name),
  +  log("plugin unloaded"),
  +
  +  % unload config
  +  ok = unload_config(Name, Version),
  +  log("config unloaded"),
  +
  +  % delete files
  +  ok = delete_files(Name, Version),
  +  log("files deleted"),
  +
  +  % delete code path
  +  ok = del_code_path(Name, Version),
  +  log("deleted code path"),
  +
  +  % unregister plugin
  +  ok = unregister_plugin(Name),
  +  log("unregistered plugin"),
  +
  +  % done
  +  ok.
   
   %% * * *
   
  
positive.code: 
  
  %% 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(
        fun load_config_file/1,
        filelib:wildcard(
          filename:join(
            [plugin_dir(), get_file_slug(Name, Version),
             "priv", "default.d", "*.ini"]))).
  
  -spec load_config_file(string()) -> ok.
  load_config_file(File) ->
      {ok, Config} = couch_config:parse_ini_file(File),
      lists:foreach(fun set_config/1, Config).
  
  -spec set_config({{string(), string()}, string()}) -> ok.
  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) ->
  
negative.code:       Else
    end.
  
  -spec del_code_path(string(), string()) -> ok | {error, atom()}.
  del_code_path(Name, Version) ->
    PluginPath = plugin_dir() ++ "/" ++ get_file_slug(Name, Version) ++ "/ebin",
    case code:del_path(PluginPath) of
      true -> ok;
      _Else ->
        ?LOG_DEBUG("Failed to delete PluginPath: '~s', ignoring", [PluginPath]),
        ok
    end.
  
  %% * * *
  
  
  %% Load Plugin
  %% This uses `appliction:load(<plugnname>)` to load the plugin
  %% and `appliction:unload(<plugnname>)` to unload the plugin.
  
  -spec load_plugin(string()) -> ok | {error, atom()}.
  load_plugin(NameList) ->
    Name = list_to_atom(NameList),
    application:load(Name).
  
  -spec unload_plugin(string()) -> ok | {error, atom()}.
  unload_plugin(NameList) ->
    Name = list_to_atom(NameList),
    application:unload(Name).
  
  %% * * *
  
  
  -spec untargz(string()) -> {ok, string()} | {error, string()}.
  