Skip to content
This repository has been archived by the owner on Jan 9, 2022. It is now read-only.

Commit

Permalink
stop downloading source file for every checksum
Browse files Browse the repository at this point in the history
i don't know why i did this
  • Loading branch information
Seth Flynn committed Jul 12, 2021
1 parent 522bd59 commit 6a9f285
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions aur-update
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ then
exit
fi

MD5SUM="$(curl -sL $2 | md5sum | cut -d ' ' -f 1)"
curl -fsSLo temp $2

MD5SUM="$(md5sum temp | cut -d ' ' -f 1)"
MD5="('$MD5SUM')"
SHA1SUM="$(curl -sL $2 | sha1sum | cut -d ' ' -f 1)"
SHA1SUM="$(sha1sum temp | cut -d ' ' -f 1)"
SHA1="('$SHA1SUM')"
SHA256SUM="$(curl -sL $2 | sha256sum | cut -d ' ' -f 1)"
SHA256SUM="$(sha256sum temp | cut -d ' ' -f 1)"
SHA256="('$SHA256SUM')"
SHA224SUM="$(curl -sL $2 | sha224sum | cut -d ' ' -f 1)"
SHA224SUM="$(sha224sum temp | cut -d ' ' -f 1)"
SHA224="('$SHA224SUM')"
SHA384SUM="$(curl -sL $2 | sha384sum | cut -d ' ' -f 1)"
SHA384SUM="$(sha384sum temp | cut -d ' ' -f 1)"
SHA384="('$SHA384SUM')"
SHA512SUM="$(curl -sL $2 | sha512sum | cut -d ' ' -f 1)"
SHA512SUM="$(sha512sum temp | cut -d ' ' -f 1)"
SHA512="('$SHA512SUM')"
B2SUM="$(curl -sL $2 | b2sum | cut -d ' ' -f 1)"
B2SUM="$(b2sum temp | cut -d ' ' -f 1)"
B2="('$B2SUM')"
SOURCE="('$2')"

Expand All @@ -31,3 +33,5 @@ sed -i "s/sha384sums=.*/sha384sums=$SHA384/" PKGBUILD > /dev/null
sed -i "s/sha512sums=.*/sha512sums=$SHA512/" PKGBUILD > /dev/null
sed -i "s/b2sums=.*/b2sums=$B2/" PKGBUILD > /dev/null
sed -i "s|source=.*|source=$SOURCE|" PKGBUILD > /dev/null

rm temp

0 comments on commit 6a9f285

Please sign in to comment.