anchor.diff:  -type download_result() :: {bad_download, binary() | string()} |
                              {fetch_fail, _, _} | cached_result().
   
  +%%==============================================================================
  +%% Public API
  +%%==============================================================================
   -spec lock(AppDir, Source) -> Res when
         AppDir :: file:name(),
         Source :: tuple(),
  
positive.code:         ,etag/1
          ,ssl_opts/1]).
  
  -export([store_etag_in_cache/2]).
  
  -include("rebar.hrl").
  
negative.code:       ETagPath :: file:name(),
        UpdateETag :: boolean(),
        Res :: download_result().
  cached_download(TmpDir, CachePath, Pkg={pkg, Name, Vsn, _Hash}, Url, ETag,
                  State, ETagPath, UpdateETag) ->
      case request(Url, ETag) of
          {ok, cached} ->
              ?INFO("Version cached at ~ts is up to date, reusing it", [CachePath]),
  