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:     app_exists(element(1, AppTuple), Server).
  
  
  run_reltool(Config, ReltoolConfig) ->
      {ok, Server} = reltool:start_server([sys_tuple(ReltoolConfig)]),
      case reltool:get_target_spec(Server) of
          {ok, Spec} ->
              TargetDir = target_dir(Config, sys_tuple(ReltoolConfig)),
              mk_target_dir(TargetDir),
  
              %% Post process the specification with rebar directives (if any exist)
              FinalSpec = case lists:keysearch(rebar, 1, ReltoolConfig) of
                              {value, {rebar, RebarConfig}} ->
                                  process_rebar_specs(RebarConfig, Spec);
                              false ->
                                  Spec
                          end,
  
              dump_spec(FinalSpec),
  
              case reltool:eval_target_spec(FinalSpec, code:root_dir(), TargetDir) of
                  ok ->
                      ok;
                  {error, Reason} ->
                      ?ERROR("Failed to generate target from spec: ~p\n", [Reason]),
                      ?FAIL
              end;
          {error, Reason} ->
              ?ERROR("Unable to generate spec: ~s\n", [Reason]),
              ?FAIL
      end.
  
  
  
negative.code:     end.
  
  
  clean(_Config, ReltoolFile) ->
      ReltoolConfig = load_config(ReltoolFile),
      TargetDir = target_dir(ReltoolConfig),
      rebar_file_utils:rm_rf(TargetDir),
      rebar_file_utils:delete_each(["reltool.spec"]).
  
  