anchor.diff:      validate_rel_apps(Server, sys_tuple(ReltoolConfig)),
   
       %% Finally, run reltool
  -    case catch(run_reltool(Config, ReltoolConfig)) of
  +    case catch(run_reltool(Server, Config, ReltoolConfig)) of
           ok ->
               ok;
           {error, failed} ->
  
positive.code: %% Internal functions
  %% ===================================================================
  
  sys_tuple(ReltoolConfig) ->
      case lists:keysearch(sys, 1, ReltoolConfig) of
          {value, {sys, Data}} ->
              {sys, Data};
          false ->
              ?ERROR("Failed to find {sys, ...} tuple in reltool.config.", []),
              ?FAIL
      end.
  
  load_config(ReltoolFile) ->
      %% Load the reltool configuration from the file
      case file:consult(ReltoolFile) of
          {ok, Terms} ->
              Terms;
          Other ->
              ?ERROR("Failed to load expected config from ~s: ~p\n", [ReltoolFile, Other]),
              ?FAIL
      end.
  
  
  %%
  %% Determine the name of the target directory; try the user provided name
  %% first, or fall back to the release name if that's available. If neither
  %% is available, just use "target"
  %%
  target_dir(Config, {sys, ReltoolConfig}) ->
    case rebar_config:get(Config, target_name, undefined) of
        undefined ->
            case lists:keysearch(rel, 1, ReltoolConfig) of
                {value, {rel, Name, _Vsn, _Apps}} ->
                    Name;
                false ->
                    "target"
            end;
        Name ->
            Name
    end.
  
  validate_rel_apps(ReltoolServer, {sys, ReltoolConfig}) ->
      case lists:keysearch(rel, 1, ReltoolConfig) of
  
negative.code:                 [] ->
                      ok;
                  _ ->
                      ?ABORT("Apps in {rel, ...} section not found by reltool: ~p\n", [Missing])
              end;
          {value, Rel} ->
              %% Invalid release format!
              ?ABORT("Invalid {rel, ...} section in reltools.config: ~p\n", [Rel]);
          false ->
              ok
      end.
  