anchor.diff:  download(TmpDir, Pkg, State) ->
       download(TmpDir, Pkg, State, true).
   
  +%%------------------------------------------------------------------------------
  +%% @doc
  +%% Download the given pkg. The etag belonging to the pkg file will be updated
  +%% only if the UpdateEtag is true and the ETag returned from the hexpm server
  +%% is different.
  +%% @end
  +%%------------------------------------------------------------------------------
   -spec download(TmpDir, Pkg, State, UpdateETag) -> Res when
         TmpDir :: file:name(),
         Pkg :: {pkg, Name :: binary(), Vsn :: binary(), Hash :: binary()},
  
positive.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]),
  
negative.code:     ok;
  maybe_store_etag_in_cache(true = _UpdateETag, Path, ETag) ->
      store_etag_in_cache(Path, ETag).
  