Skip to content

Commit

Permalink
tool/downloader.rb: Stop caching already existing files
Browse files Browse the repository at this point in the history
Previously, the script was caching any file already present in the
destination directory, regardless of its origin. This caused issues
when the directory contained files copied from external sources like
`autoreconf --install`.

For example:
1. `./autogen.sh --install` copies `config.guess` and `config.sub`
   from the system to `./tool`.
2. `ruby tool/downloader.rb -d tool -e gnu config.guess config.sub`
   treats those files as if they were downloaded and caches them.
3. Removing the files: `rm tool/config.guess tool/config.sub`.
4. Running the downloader again, it mistakenly restores the cached
   files instead of downloading fresh versions.
  • Loading branch information
kateinoigakukun authored and hsbt committed Feb 13, 2025
1 parent 45397f8 commit d35cc0c
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions tool/downloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ def self.download(url, name, dir = nil, since = true,
$stdout.puts "#{file} already exists"
$stdout.flush
end
if cache_save
save_cache(cache, file, name)
end
return file.to_path
end
if dryrun
Expand Down

0 comments on commit d35cc0c

Please sign in to comment.