1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-28 07:51:19 +01:00
crasbe c9c3ed2733 pkg,dist/tools: repl. DOWNLOAD_TO_FILE w/ DLCACHE, enh. dlcache.sh
The dlcache script is useful to avoid unnecessary repeated downloads
of zip archives, similar to the git-cache scripts. The command order
was changed to stay compatible with DOWNLOAD_TO_FILE and the only other
usage of $(DLCACHE) was changed accordingly.

To avoid the risk of collisions, dlcache now uses SHA512 sums instead
of MD5.
If no SHA512 checksum is given to dlcache.sh, it will just act as
$(DOWNLOAD_TO_FILE).
2025-10-23 21:54:29 +02:00
..

Introduction

This script aims to cache http(s)-downloads of (mainly) zip archives.

How it works

  • if a file with the right name and SHA512 exists, nothing happens
  • if a file with the right name and SHA512 is in cache, use that
  • if a file with the right name but wrong SHA512 is in cache, redownload download to cache
  • after download, check SHA512, then copy to target
  • if no SHA512 checksum is given, always redownload

Usage

In order to stay compatible with the $(DOWNLOAD_TO_FILE) command, the command usage was changed for Release 2025.10.

If no SHA512 checksum was given, the file will always be downloaded, regardless of whether it is in the cache or not.

dist/tools/dlcache/dlcache.sh <output_folder> <URL> [SHA512 checksum]