1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00
Marian Buschsieweke 21824cc09f
dist/tools/dlcache: make script more portable
- do not use `bash` in shebang, e.g. containers may not ship bash
- do not use `flock -w <timeout_secs> ...`, but
  `timeout <timeout_secs> flock ...` to be portable to even busybox's
  flock implementation
- sha512sum is more common on Linux than shasum
2025-12-02 11:43:19 +01: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]