Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache and downloads #3491

Closed
hannesm opened this issue Aug 1, 2018 · 2 comments
Closed

cache and downloads #3491

hannesm opened this issue Aug 1, 2018 · 2 comments

Comments

@hannesm
Copy link
Member

hannesm commented Aug 1, 2018

I've a code question, while reading opamRepository.ml, in fetch_from_cache (I assumed this would take a file from a local cache), there's the following snippet:

  let dl_from_cache_job root_cache_url checksum file =
    let url = cache_url root_cache_url checksum in
    match url.OpamUrl.backend with
    | `http ->
      OpamDownload.download_as
        ~quiet:true ~validate:false ~overwrite:true ~checksum
        url file

this looks to me that it will call out to curl/wget, and taking that validate:false there will be no validation of the checksum. why?

I'd be interested in scenarios which fail if validate:true would be passed here.

@rjbou
Copy link
Collaborator

rjbou commented Aug 1, 2018

In all cases (local or http), checksums are validated afterwards, in the continuation if the download/copy succeed. And If no checksum is available, fetching from cache is not performed.

@hannesm
Copy link
Member Author

hannesm commented Aug 1, 2018

thanks!

@hannesm hannesm closed this as completed Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants