This repository has been archived on 2024-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
evolution-packages/common/xbps-src/shutils/update_hash_cache.sh

13 lines
376 B
Bash
Raw Normal View History

2023-08-05 21:19:04 +01:00
# vim: set ts=4 sw=4 et:
update_hash_cache() {
local cache="$XBPS_SRCDISTDIR/by_sha256"
local distfile curfile
mkdir -p "$cache"
find "$XBPS_SRCDISTDIR" -type f | grep -v by_sha256 | while read -r distfile; do
cksum=$($XBPS_DIGEST_CMD "$distfile")
curfile="${distfile##*/}"
ln -vf "$distfile" "${cache}/${cksum}_${curfile}"
done
}