hopefuly fix sha1sum calling; also refactor and check downloaded program's sha before using it

This commit is contained in:
Joey Hess 2015-10-06 16:44:12 -04:00
parent 862a125094
commit c83472145c

View file

@ -62,16 +62,24 @@ fi
# These are msys2 programs, from https://msys2.github.io/. # These are msys2 programs, from https://msys2.github.io/.
# Since git for windows uses msys2, and includes its libraries, # Since git for windows uses msys2, and includes its libraries,
# these programs will work well with it. # these programs will work well with it.
if [ ! -e rsync.exe ] || [ "$(sha1sum rsync.exe)" != "85cb7a4d16d274fcf8069b39042965ad26abd6aa" ]; then getextra () {
rm -f rsync.exe || true extrap="$1"
withcyg wget https://downloads.kitenet.net/git-annex/windows/assets/rsync.exe extrasha="$2"
withcyg chmod +x rsync.exe curextrasha="$(withcyg sha1sum $extrap)"
fi if [ ! -e "$extrap" ] || [ "$curextrasha" != "$extrasha" ]; then
if [ ! -e wget.exe ] || [ "$(sha1sum wget.exe)" != "044380729200d5762965b10123a4f134806b01cf" ]; then rm -f "$extrap" || true
rm -f wget.exe || true withcyg wget https://downloads.kitenet.net/git-annex/windows/assets/$extrap
withcyg wget https://downloads.kitenet.net/git-annex/windows/assets/wget.exe curextrasha="$(withcyg sha1sum $extrap)"
withcyg chmod +x wget.exe if [ "$curextrasha" != "$extrasha" ]; then
fi rm -f "$extrap"
echo "CHECKSUM FAILURE" >&2
exit 1
fi
withcyg chmod +x $extrap
fi
}
getextra rsync.exe 85cb7a4d16d274fcf8069b39042965ad26abd6aa
getextra wget.exe 044380729200d5762965b10123a4f134806b01cf
# Build the installer # Build the installer
cabal install nsis cabal install nsis