Skip to content

Commit d5a78e2

Browse files
committed
use tools/sha256sum.py since macos image does not have sha256sum
1 parent eef7a05 commit d5a78e2

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tools/gfortran_utils.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ if [ "$(uname)" == "Darwin" ]; then
127127
;;
128128
*) echo Did not recognize arch-plat $arch-$plat; return 1 ;;
129129
esac
130-
if [[ "$(sha256sum gfortran-darwin-${arch}-${type}.tar.gz)" != "${GFORTRAN_SHA} gfortran-darwin-${arch}-${type}.tar.gz" ]]; then
130+
if [[ "$(python3 tools/sha256sum.py gfortran-darwin-${arch}-${type}.tar.gz)" != "${GFORTRAN_SHA} gfortran-darwin-${arch}-${type}.tar.gz" ]]; then
131131
echo "shasum mismatch for gfortran-darwin-${arch}-${type}"
132132
exit 1
133133
fi

tools/sha256sum.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env python3
2+
3+
import hashlib
4+
import sys
5+
6+
filename = sys.argv[1]
7+
sha256_hash = hashlib.sha256()
8+
with open(filename,"rb") as f:
9+
# Read and update hash string value in blocks
10+
for byte_block in iter(lambda: f.read(32768),b""):
11+
sha256_hash.update(byte_block)
12+
print(sha256_hash.hexdigest())
13+

0 commit comments

Comments
 (0)