Skip to content

cache_dir doesn't do what you think it does #85

@ju5t

Description

@ju5t

From the README:

This caches the downloaded file in an intermediate directory to avoid repeatedly downloading it. This uses the timestamping (-N) and prefix (-P) wget options to only re-download if the source file has been updated.

   wget::fetch { 'https://tool.com/downloads/tool-1.0.tgz':
     destination => '/tmp/',
     cache_dir   => '/var/cache/wget',
   }

But if you specify cache_dir it actually keeps downloading the file over and over again.

This was introduced in commit back in 2015 from @mirthy (023ed15):

if $redownload == true or $cache_dir != undef  {

Ref: #L62

Is this for any particular reason? Apparently using cache_dir is the only way to set additional parameters on our files such as mode so we prefer to remove the $cache_dir != undef.

I don't mind raising a pull request for it but I wonder what we may break. Can someone shed a light on this perhaps?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions