anchor.diff:  
   clean(Config, ReltoolFile) ->
       ReltoolConfig = load_config(ReltoolFile),
  -    TargetDir = target_dir(Config, ReltoolConfig),
  +    TargetDir = target_dir(Config, sys_tuple(ReltoolConfig)),
       rebar_file_utils:rm_rf(TargetDir),
       rebar_file_utils:delete_each(["reltool.spec"]).
   
  
positive.code: %% first, or fall back to the release name if that's available. If neither
  %% is available, just use "target"
  %%
  target_dir(Config, ReltoolConfig) ->
    case rebar_config:get(Config, target_name, undefined) of
        undefined ->
            case lists:keysearch(rel, 1, ReltoolConfig) of
  
negative.code:             ok
      end.
              
  post_process_spec(ReltoolConfig, Spec) ->
      case lists:keysearch(rebar, 1, ReltoolConfig) of
          {value, RebarConfig} ->
              process_rebar_specs(RebarConfig, Spec);
          false ->
              Spec
      end.
  
  process_rebar_specs([], Spec) ->
      Spec;
  process_rebar_specs([{empty_dirs, Dirs} | Rest], Spec) ->
      Spec2 = lists:foldl(fun(Dir, SpecAcc) ->
                                  spec_create_dir(filename:split(Dir), SpecAcc)
                          end, Spec, Dirs),
      process_rebar_specs(Rest, Spec2);
  process_rebar_specs([ Other | Rest], Spec) ->
      ?WARN("Ignoring unknown rebar spec: ~p\n", [Other]),
      process_rebar_specs(Rest, Spec).
  
  
  spec_create_dir([], Spec) ->
      Spec;
  spec_create_dir([Path | Rest], Spec) ->
      case lists:keysearch(Path, 2, Spec) of
          {value, {create_dir, Path, Subspec}} ->
              %% Directory already exists; process down into
              %% Note: this is not tail recursive, but unless the directory structure
              %% is insanely deep, shouldn't be a problem
              lists:keystore(Path, 2, Spec, {create_dir, Path, spec_create_dir(Rest, Subspec)});
          {value, Other} ->
              %% Collision -- something other than create_dir is associated with this
              %% portion of our path name.
              ?ERROR("Collision of path name with existing tuple in spec: ~p\n", [Other]),
              ?FAIL;
          false ->
              %% Directory doesn't yet exist
              [{create_dir, Path, spec_create_dir(Rest, [])} | Spec]
      end.
  
  