Files
oasis-linux-mirror/scripts/fetch-curl.sh
T
Michael Forney 2eddb78d1b Store dist files in config.distdir
This makes it easy to remove old distfiles with `git clean -f dist`.
2026-03-12 16:40:37 -07:00

32 lines
576 B
Bash

set -e
if [ "$#" != 1 ] ; then
echo 'usage: fetch-curl.sh dir' >&2
exit 2
fi
. ./paths.sh
dir=$1
shift
cd "$distdir"
if ! sh "$basedir/scripts/checksum.sh" -c "$basedir/$dir/sha256" 2>/dev/null ; then
curl -L -K "$basedir/$dir/url" -O
sh "$basedir/scripts/checksum.sh" -c "$basedir/$dir/sha256"
fi
cd "$basedir/$dir"
if [ -e src ] ; then
rm -rf src
fi
while read -r _ archive ; do
sh "$basedir/scripts/extract.sh" "$distdir/$archive" -s ',^[^/]*,src,'
done <sha256
if [ -d patch ] ; then
git apply -v --whitespace=nowarn --directory "$dir/src" patch/*.patch
fi