anchor.diff:                end, Specs)
       end.
   
  -clean(Config, AppFile) ->
  -    %% TODO: remove SpecType and OldSources make get_specs/2
  -    %%       return list(#spec{}) when removing deprecated options
  -    {Config1, {SpecType, {OldSources, Specs}}} = get_specs(Config, AppFile),
  -
  -    case {SpecType, OldSources, Specs} of
  -        {old, [], _} ->
  -            ok;                                 % old specs empty
  -        {new, [], []} ->
  -            ok;                                 % port_specs empty
  -
  -        _ ->                                    % have old/new specs
  -
  +clean(Config, _AppFile) ->
  +    case get_specs(Config) of
  +        [] ->
  +            ok;
  +        Specs ->
               lists:foreach(fun(#spec{target=Target, objects=Objects}) ->
                                     rebar_file_utils:delete_each([Target]),
                                     rebar_file_utils:delete_each(Objects)
                             end, Specs)
       end,
  -    {ok, Config1}.
  +    ok.
   
   setup_env(Config) ->
       setup_env(Config, []).
  
positive.code:         []     -> Target ++ ".exe";
          _Other -> Target
      end.
  
  %% TODO: DEPRECATED: remove support for non-port_specs syntax [old_*()]
  old_get_specs(Config, AppFile) ->
      OsType = os:type(),
      SourceFiles = old_get_sources(Config),
      {NewConfig, Specs} =
          case rebar_config:get_local(Config, so_specs, undefined) of
              undefined ->
                  Objects = port_objects(SourceFiles),
                  %% New form of so_specs is not provided. See if the old form
                  %% of {so_name} is available instead
                  Dir = "priv",
                  {Config2, SoName} =
                      case rebar_config:get_local(Config, so_name, undefined) of
                          undefined ->
                              %% Ok, neither old nor new form is
                              %% available. Use the app name and
                              %% generate a sensible default.
                              {Config1, AppName} =
                                  rebar_app_utils:app_name(Config, AppFile),
                              DrvName = ?FMT("~s_drv.so", [AppName]),
                              {Config1, filename:join([Dir, DrvName])};
                          AName ->
                              %% Old form is available -- use it
                              {Config, filename:join(Dir, AName)}
                      end,
                  {Config2, [old_get_so_spec({SoName, Objects}, OsType)]};
              SoSpecs ->
                  {Config, [old_get_so_spec(S, OsType) || S <- SoSpecs]}
          end,
      {NewConfig, {SourceFiles, Specs}}.
  
  old_get_sources(Config) ->
      RawSources = rebar_config:get_local(Config, port_sources,
                                          ["c_src/*.c"]),
      FilteredSources = old_filter_port_sources(RawSources),
      old_expand_sources(FilteredSources).
  
  old_filter_port_sources(PortSources) ->
      [S || S <- PortSources, old_is_arch_port_sources(S)].
  
  old_is_arch_port_sources({Arch, _Sources}) -> rebar_utils:is_arch(Arch);
  old_is_arch_port_sources(_Sources)         -> true.
  
  old_expand_sources(Sources) ->
      lists:flatmap(fun filelib:wildcard/1, Sources).
  
  old_get_so_spec({Target, Objects}, OsType) ->
      #spec{type=drv,
            target=maybe_switch_extension(OsType, Target),
            sources=[],
            objects=Objects,
            opts=[]}.
  
  %%
  %% == port_env ==
  
negative.code:         match -> true;
          nomatch -> false
      end.
  
  %%
  %% Filter a list of env vars such that only those which match the provided
  