1
0
Fork 0
mirror of https://github.com/xHyroM/void-packages.git synced 2024-11-10 00:48:06 +01:00
void-packages/common/xbps-src/shutils/update_hash_cache.sh
2024-03-29 08:12:19 +01:00

12 lines
376 B
Bash

# 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
}