fetch-curl.sh (576B)
1 set -e 2 3 if [ "$#" != 1 ] ; then 4 echo 'usage: fetch-curl.sh dir' >&2 5 exit 2 6 fi 7 8 . ./paths.sh 9 dir=$1 10 shift 11 12 cd "$distdir" 13 14 if ! sh "$basedir/scripts/checksum.sh" -c "$basedir/$dir/sha256" 2>/dev/null ; then 15 curl -L -K "$basedir/$dir/url" -O 16 sh "$basedir/scripts/checksum.sh" -c "$basedir/$dir/sha256" 17 fi 18 19 cd "$basedir/$dir" 20 21 if [ -e src ] ; then 22 rm -rf src 23 fi 24 25 while read -r _ archive ; do 26 sh "$basedir/scripts/extract.sh" "$distdir/$archive" -s ',^[^/]*,src,' 27 done <sha256 28 29 if [ -d patch ] ; then 30 git apply -v --whitespace=nowarn --directory "$dir/src" patch/*.patch 31 fi